3

I am using python 2.7 on anaconda notebook on mac. Numpy was working perfectly along with tensorflow until I tried to install OpenCV using (pip install OpenCV). It now produces an error as shown

RuntimeError: module compiled against API version 0xa but this version of numpy is 0x7
Traceback (most recent call last):
ImportError: numpy.core.multiarray failed to import

I have tried all the ways to install numpy, but I keep getting this message:

Requirement already satisfied: numpy in ./anaconda/lib/python2.7/site-packages

I even tried to reinstall it and install it again, but still, the same message shows up.

RaminNietzsche
  • 2,683
  • 1
  • 20
  • 34
engalsh
  • 47
  • 5
  • From the exception it clearly indicates that numpy versions are not matching. You can check numpy versions as follows. I will also think how to further narrow down and fix it. http://stackoverflow.com/questions/1520234/how-to-check-which-version-of-numpy-im-using – Validus Oculus Apr 18 '17 at 14:42
  • I guess following page will help you to fix it, please check: http://stackoverflow.com/questions/28517937/how-can-i-upgrade-numpy – Validus Oculus Apr 18 '17 at 14:45
  • Possible duplicate of [RuntimeError: module compiled against API version a but this version of numpy is 9](http://stackoverflow.com/questions/33859531/runtimeerror-module-compiled-against-api-version-a-but-this-version-of-numpy-is) – RaminNietzsche Apr 18 '17 at 14:52

1 Answers1

2

Try to upgrade numpy

pip install numpy --upgrade

Then check your path:

import numpy
print numpy.__path__

Maybe you need to move some files, look this question.

Community
  • 1
  • 1
RaminNietzsche
  • 2,683
  • 1
  • 20
  • 34