pip进行numpy升级出现version版本过低问题

1.问题

在Python3.6版本下,一般程序如果需要numpy正常import就可以匹配,numpy版本无过分要求。但在tensorflow运行时,可能会出现以下错误:

ImportError:Something is wrong with the numpy installation. 
While importing we 	detected an older version of numpy in ['/home/.local/lib/python3.6/site-packages/numpy'].
One method of fixing this is to repeatedly uninstall numpy until none is found, then reinstall this version.

2.解决办法

原因是tensorflow和opencv有依赖关系,numpy版本没有更新,导致出错

在尝试使用

pip3 install -U numpy

进行升级,但程序仍然出错:

One method of fixing this is to repeatedly uninstall numpy until none is found, then reinstall this version.

用pip3 uninstall numpy卸载numpy,再用pip3 list命令查看是否还有numpy存在,若有,再继续卸载,否则老版本还是会报错。确定无numpy之后,重新安装新版本:

pip3 install numpy

安装成功,可以正常运行程序。

 

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值