Skip to content

Instantly share code, notes, and snippets.

@dmofot
Last active October 10, 2017 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmofot/e598a6682c930abf322158d2fd1cc2a9 to your computer and use it in GitHub Desktop.
Save dmofot/e598a6682c930abf322158d2fd1cc2a9 to your computer and use it in GitHub Desktop.
How to fix RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9

Had an issue after upgrading QGIS. For some reason it was picking up an older version of numpy and throwing the error:

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

Turns out the system python had an old version of numpy installed. To figure this out:

$ /usr/bin/python
Python 2.7.10 (default, Feb  7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.9.2'
>>> numpy.__path__
['/Library/Python/2.7/site-packages/numpy-override/numpy']
>>> exit()

The fix was simply moving that dir: $ sudo mv /Library/Python/2.7/site-packages/numpy-override/numpy /Library/Python/2.7/site-packages/numpy-override/numpy_old

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment