RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa

兩個python,一個是本機自帶的,一個是anaconda。先前呢,用自帶的安裝了Opencv,因爲自帶的python,對應的numpy版本是13,python

而anaconda對應的版本是12,致使import 報錯:this

>>> import cv2
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: numpy.core.multiarray failed to import
>>> import numpy
>>> exit()ip

 

而後,升級一下numpy就能夠了。it

pip install numpy --upgradepip

 

這些都是些小碎片。整理一下給你們。幫助你們節約環境搭建的時間。io

相關文章
相關標籤/搜索