RuntimeError: module compiled against API version a but this version of numpy is 9 RuntimeError: module compiled against API version a but this version of numpy is 9 numpy numpy

RuntimeError: module compiled against API version a but this version of numpy is 9


upgrade numpy to the latest version

pip install numpy --upgrade


Check the path

import numpyprint numpy.__path__

For me this was /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy So I moved it to a temporary place

sudo mv /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy_old

and then the next time I imported numpy the path was /Library/Python/2.7/site-packages/numpy/init.pyc and all was well.


This worked for me:

sudo pip install numpy --upgrade --ignore-installed