0
votes

I want to use of opencv library (python module) in pycharm. I set my python interpreter in setting and also add opencv path (C:\opencv\build\python\2.7) to python interpreter path. but unfortunately pycharm couldn't import opecv library. It's noticeable that I see the cv2.pyd in the left panel (project panel).

import cv2

and after that I got: Traceback (most recent call last): File "C:/Users/PlotPSO.py", line 13, in import cv2.cv ImportError: DLL load failed: %1 is not a valid Win32 application.

  • pycharm ver: 2.7.2
  • opencv ver: 2.4.4
  • python ver: 2.7.4
  • windows ver: 7 (x64)
1

1 Answers

0
votes

If you have correctly added OpenCV to your python path, then it might be an architecture mismatch problem.
Check to see that both of your OpenCV binaries and Python interpreter are 32bit or 64bit.

To see if you have 32bit or 64bit python, check the output of:

>>> import platform
>>> platform.platform()

If you haven't build OpenCV yourself for 64bit architecture, your OpenCV should be a 32bit version.