close

[Solved] Runtime: module compiled against API version a but this version of numpy is 9

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Runtime: module compiled against API version a but this version of numpy is 9 in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Runtime: module compiled against API version a but this version of numpy is 9 Error Occurs?

Today I get the following error Runtime: module compiled against API version a but this version of numpy is 9 in python.

How To Solve Runtime: module compiled against API version a but this version of numpy is 9 Error ?

  1. How To Solve Runtime: module compiled against API version a but this version of numpy is 9 Error ?

    To Solve Runtime: module compiled against API version a but this version of numpy is 9 Error and then the next time I imported numpy the path was /Library/Python/2.7/site-packages/numpy/init.pyc and all was well.

  2. Runtime: module compiled against API version a but this version of numpy is 9

    To Solve Runtime: module compiled against API version a but this version of numpy is 9 Error and then the next time I imported numpy the path was /Library/Python/2.7/site-packages/numpy/init.pyc and all was well.

Solution 1

upgrade numpy to the latest version

pip install numpy --upgrade

Solution 2

Check the path

import numpy
print 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.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read