0
votes

I tried to import the cv2 package in windows and I got the error:

>>> import numpy
>>> numpy.version.version
'1.6.1'
>>> import cv2
RuntimeError: module compiled against API version 0xa but this version of numpy is 0x6

Traceback (most recent call last): File "", line 1, in import cv2 ImportError: numpy.core.multiarray failed to import

I have also tried numpy verson 1.11.1 but it didn't work.

1

1 Answers

0
votes

You should ensure that you have a single version of numpy installed, assuming you are not working within a virtualenv. Python may still be loading the old numpy package. If that is the case, you will need to remove the old version, or, to make things easier in the long run, use a virtualenv with only the packages you require.

You can check the numpy path:

import numpy
print numpy.__path__