I am trying to install open cv for Python 2.7 and Windows 32 and keep on getting errors


I am getting this error:

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

on > 21 import cv2

in Pepper-Controller-main\pepper\robot.py

downloaded from GitHub - incognite-lab/Pepper-Controller: Python controller for Pepper humanoid robot. It allows to write apps in Python. There are examples of simple applications for Pepper. We develop GUI to operate the robot and run custom apps

Pepper Nao SDK requires Python 2.7 and obviously windows 32. I followed the steps here OpenCV: Install OpenCV-Python in Windows

whether copying the brebuilt from [opencv-4.5.4-vc14_vc15.exe] the only one that I found Python 2.7 cv2.pyd to copy to C:/Python27/lib/site-packages.
and found in it opencv_world454.dll file to C:/Python27/lib/site-packages. I tried to copy from vc14 and vc15 and all failed. I also tried using CMAKE and managed to configure and generate and opened the project in Visual STudio. I tried to build the release to win32 platform for gen_opencv_python_source, INSTALL, opencv_modules, openvc_python2, opencv_version_win32, opencv_world, but I got the one build succeeded and others failed, and could not fix the errors,

I appreciate if anyone explain the shortest steps to get this running, as I am trying different combinations of choices that might take me for ever,

thank you very much,


the prebuilt cv2.pyd should be statically linked, and thus NOT require any other opencv dll. (even outdated 4.5.4 ! )

IF you build from src, set BUILD_SHARED_LIBS=OFF (cmake flag) , so it will build a ‘fat’ (>80mb) cv2.pyd w/o any further dll dependencies