1. 程式人生 > >RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa

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

cal conda stdin his runt port imp compile pip

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

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

>>> 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()

然後,升級一下numpy就可以了。

pip install numpy --upgrade

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

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