0

I am running a WIndows 10 operating system. I have downloaded an install file for OpenCV 2.4.11 for Python 2.7, ran the self extract (extracted to C:), and copied the correct version of cv2.pyd into C:\Python27\Lib\site-packages; but whenever I restart the command line and enter

import cv2

I get an error message:

ImportError: DLL load failed: %1 is not a valid Win32 application.

I have searched all over the internet for hours on how to fix this; and have seen hundreds of results that told me to do what I have already done. I have heard that I need to "add the new opencv binaries path (C:\opencv\build\bin\Release) to the Windows PATH environment variable", but whenever I put a semi-colon in the text box for editing an environment variable (just like what I have heard you are supposed to do) and press enter, the text goes back to what it was before. Isn't there an easier way to install OpenCV? Any help would be greatly appreciated!

Thanks.

Theoden
  • 21
  • 1
  • 4
  • There's no need to modify `PATH`. cv2.pyd is statically linked to opencv. However, you do need the right version of the extension. Use the x86 version for 32-bit Python and the x64 version for 64-bit Python. – Eryk Sun Mar 30 '16 at 03:42
  • You also need numpy. The latest version (1.10.11) doesn't have Windows wheels available yet, but you can force installing 1.10.4: `py -2 -m pip install numpy==1.10.4`. – Eryk Sun Mar 30 '16 at 03:42

0 Answers0