ImportError: numpy.core.multiarray failed to import (import pyBigWig)

发布时间 2023-05-03 17:02:03作者: emanlee

 

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .

 
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[5], line 18
     16 import pybedtools
     17 from pybedtools import featurefuncs
---> 18 import pyBigWig

ImportError: numpy.core.multiarray failed to import



 

解决方法:

这个错误是由于numpy版本与某个库文件包,比如opencv-python版本不匹配造成的

系统原来不要有numpy这个包!!!如果你已经安装了,请先卸载numpy包,再安装opencv-python包

新建了一个文件夹,将文件移动过去了,

查看numpy 版本:pip show numpy

 

(base) [ibiomed H3K9ac]# conda activate mydlenv
您在 /var/spool/mail/root 中有邮件
(mydlenv) [ibiomed H3K9ac]# pip show numpy
Name: numpy
Version: 1.19.2

pip show pyBigWig
Name: pyBigWig
Version: 0.3.18

pip uninstall numpy

pip uninstall pyBigWig

pip install pyBigWig

  Downloading pyBigWig-0.3.22-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (196 kB)

 pip install -U numpy==1.20.0

 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pandas 1.5.3 requires numpy>=1.20.3; python_version < "3.10", but you have numpy 1.20.0 which is incompatible.

pip uninstall numpy

pip install -U numpy==1.20.3

 

 

 REF

https://blog.csdn.net/Gherbirthday0916/article/details/124068925

https://blog.csdn.net/Robin_Pi/article/details/120544691

https://blog.csdn.net/CT_WJ/article/details/94602681