Numpy报错:ImportError: numpy.core.multiarray failed to import

导入自定义的 python 模块时,出现以下报错:

ImportError: numpy.core.multiarray failed to import
    from .cv2 import *
ImportError: numpy.core.multiarray failed to import

原因:

numpy 版本过低或者过高

解决:

  • 查看numpy 版本:pip show numpy
    我当前环境中的 numpy 版本是:Version: 1.16.5
  • 升级:pip install -U numpy
(tensorflow) Robin-macbook-pro:~ robin$ pip install -U numpy
Collecting numpy
  Downloading https://files.pythonhosted.org/packages/6a/9d/984f87a8d5b28b1d4afc042d8f436a76d6210fb582214f35a0ea1db3be66/numpy-1.19.5-cp36-cp36m-macosx_10_9_x86_64.whl (15.6MB)
     |████████████████████████████████| 15.6MB 1.3MB/s 
ERROR: tensorflow 1.13.1 has requirement protobuf>=3.6.1, but you'll have protobuf 3.6.0 which is incompatible.
Installing collected packages
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值