当我使用brew安装OpenCV时,每当我运行这个命令来测试python -c“import cv2”时,我得到这个问题
RuntimeError: module compiled against API version 9 but this version of numpy is 6
Traceback (most recent call last):
File "", line 1, in
ImportError: numpy.core.multiarray failed to import
我试图升级麻烦,但这是令人困惑的
>>> import numpy
>>> print numpy.__version__
1.6.1
当我运行brew升级numpy,我有这个问题。
brew install -u numpy
Warning: numpy-1.9.1 already installed
当我卸载它
sudo pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in ./anaconda/lib/python2.7/site-packages
我跟着这个thread,从我的mac中删除了anaconda。
pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in /Library/Python/2.7/site-packages
但没有改变。如何将numpy版本链接到opencv?