RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9 / ImportError
问题描述:安装python的opencv库后,导入时出现RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9, ImportError: numpy.core.multiarray failed to import.
系统: OSX Yosemite/Python 2.7
安装opencv库: sudo pip install opencv-python
导入opencv库: import cv2
我这报错的缘由是个人电脑在安装opencv前曾单独安装过numpy,而安装opencv的时候会自动再安装一个numpy,且两者安装在不一样的路径下面,且默认使用的是我先前安装的numpy。
解决办法: 删除先前安装的numpy库,或把各个numpy版本删除完而后重装一遍opencv。
手动删除方法:
import numpy
print numpy.__path__ (找到numpy存在的路径,而后删除它)
相关文章
1. RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
2. module compiled against API version 0xb but this version of numpy is 0xa
3. 在tensorflow下运行代码出错——API version 0xc but this version of numpy is 0xb
4. ImportError: this is MySQLdb version (1, 2, 5, 'final', 1), but _mysql is version (1, 4, 4, 'final',
5. ImportError: numpy.core.multiarray failed to import解决办法
6. grep: this version of PCRE is not compiled with PCRE_UTF8 support
7. ImportError: numpy.core.multiarray failed to import
8. At least one Instantiations product installed into this version of Eclipse was compiled
9. Conflicting versions of ASP.NET Web Pages detected: specified version is “1.0.0.0”, but the version
10. This version of the rendering library is more rece
更多相关文章...
• Docker version 命令
- Docker命令大全
• XSLT 元素
- XSLT 教程
• 三篇文章了解 TiDB 技术内幕——说存储
• Java 8 Stream 教程
相关标签/搜索
欢迎关注本站公众号,获取更多信息
相关文章
1.
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
2.
module compiled against API version 0xb but this version of numpy is 0xa
3.
在tensorflow下运行代码出错——API version 0xc but this version of numpy is 0xb
4.
ImportError: this is MySQLdb version (1, 2, 5, 'final', 1), but _mysql is version (1, 4, 4, 'final',
5.
ImportError: numpy.core.multiarray failed to import解决办法
6.
grep: this version of PCRE is not compiled with PCRE_UTF8 support
7.
ImportError: numpy.core.multiarray failed to import
8.
At least one Instantiations product installed into this version of Eclipse was compiled
9.
Conflicting versions of ASP.NET Web Pages detected: specified version is “1.0.0.0”, but the version
10.
This version of the rendering library is more rece