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