Ask Your Question
0

problem installing opencv-python on Windows

asked 2016-07-19 14:10:48 -0600

RexSr gravatar image

updated 2016-07-19 14:12:50 -0600

I am a newbie to python and opencv although I have been programming in various languages (but mostly 'c') for some time. I am trying to follow the tutorial to install opencv-python on Windows 7/sp1 x64 on the web page: "http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_setup/py_table_of_contents_setup/py_table_of_contents_setup.html#py-table-of-content-setup"

I got down to the point where the instructions say: "import cv2" . when I enter this I get "RuntimeError: module compiled against API version 9 but this version of numpy is 7 Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: numpy.core.multiarray failed to import"

I have tried downloading 3.1.0, 3.0.0, and 2.4.13 of the opencv with the same error.

any suggestions what I can do to get past this problem.

edit retag flag offensive close merge delete

Comments

please try to update numpy (not opencv) to latest version

berak gravatar imageberak ( 2016-07-19 14:12:38 -0600 )edit

OK, thanks I will give it a try.

RexSr gravatar imageRexSr ( 2016-07-19 17:02:48 -0600 )edit

I have found that installing a later version of numpy is rather difficult as there does not seem to be a binary available. I have downloaded the build from anaconda (supposedly has both Python 2.7 and Numpy) and will give that a try instead.

RexSr gravatar imageRexSr ( 2016-07-19 21:04:57 -0600 )edit

I've successfully installed numpy 1.11 (numpy.org) : setup.py build, setup.py install win-amd..py. Numpy installs itself in /users/appdata/local/programs/Python /python35/lib/site-packages/numpy-1.11.1 Had cmake complain of import trouble, it turned out to be reference to numpy include directory. By the way if you're using cmake, cmake prefers python 3.5.x

tacocat88 gravatar imagetacocat88 ( 2016-07-19 21:15:22 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-07-19 21:37:01 -0600

RexSr gravatar image

Using the Anaconda build enabled me to get past the hurdle of getting a numpy that is compatible. Copying the cv2.pyd from opencv to the C:\Users\rex\AppData\Local\Continuum\Anaconda2\DLLs directory allowed me to import cv2 with no errors (previous download of opencv).
I am now trying to work through the "Building OpenCV from source" so I guess we can consider this question answered.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-07-19 14:10:48 -0600

Seen: 1,339 times

Last updated: Jul 19 '16