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

Posted python_boy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa相关的知识,希望对你有一定的参考价值。

两个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的主要内容,如果未能解决你的问题,请参考以下文章

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

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

RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9 / ImportError

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

__init__.py",第 92 行,在 <module> 中引发 RuntimeError("Python 3.5 或更高版本是必需的")

解决 RuntimeError: module compiled against API version 0xf but this version of numpy is 0xd