When I installed OpenCV using Homebrew (brew
), I got this problem whenever I run this command to test python -c "import cv2"
:
RuntimeError: module compiled against API version 9 but this version of numpy is 6
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: numpy.core.multiarray failed to import
I tried to upgrade NumPy, but this is confusing:
>>> import numpy
>>> print numpy.__version__
1.6.1
When I run brew to upgrade NumPy, I got this problem:
brew install -u numpy
Warning: numpy-1.9.1 already installed
When I uninstalled it:
sudo pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in ./anaconda/lib/python2.7/site-packages
I have followed this question and deleted Anaconda from my mac.
pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in /Library/Python/2.7/site-packages
But nothing have changed. How can I link the NumPy version to OpenCV?
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
, and (b) this is generally not a good approach, – Bedrail