Numpy报错解决办法

bug描述:

经常出现加载numpy会报错或者在安装tensoflow、pytorch时,出现如下错误:

问题一:

RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
Traceback (most recent call last):
  File "/home/hcguo/miniconda3/envs/wes/bin/bamCoverage", line 5, in <module>
    from deeptools.bamCoverage import main
  File "/home/hcguo/miniconda3/envs/wes/lib/python2.7/site-packages/deeptools/bamCoverage.py", line 8, in <module>
    from deeptools import writeBedGraph  # This should be made directly into a bigWig
  File "/home/hcguo/miniconda3/envs/wes/lib/python2.7/site-packages/deeptools/writeBedGraph.py", line 5, in <module>
    import pyBigWig
ImportError: numpy.core.multiarray failed to import

问题二:

 FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated;in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'._np_qint8 = np.dtype([("qint8", np.int8, 1)]) 

 解决办法:

一般这种问题都是版本问题,需要将版本降低。一般来说,numpy1.17版本都比较高,可能支持不太好,博主试了好几个都是因为1.17版本报错的原因,解决办法是:

pip3 install numpy==1.16

将版本降低,如果还是不行,则试试15,14.....

如果不想这样一个一个试就我就用下面命令查了一下我的numpy文件的版本

pip show numpy

我们回到之前的出现问题中, RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb

说明你需要的是0xc版本的numpy,然后去查一下这个对应的numpy版本,下载就好;

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值