I am currently trying to build OpenCV 4.5.2 from source with python support and so far, my build has always succeeded but then when I go to import cv2, all hell breaks loose. As indicated in the title, I get the following error message:
ImportError: DLL load failed while importing cv2: The specified module could not be found.
Now, before I came here, I tried many different things:
- Make sure that all opencv-related dlls are on my PATH (I even copied the pyd file next to all my dlls)
- Make sure python3.dll is on my path
- Make sure I only have a single version of python installed
Nothing seems to do. On Linux, the same build (yay conan!) gave me a bit of a headache too to get cv2 to import but then with the magic of nm/ldd I figured out what symbols were missing (OpenEXR could not be built as a static lib for some reason).
On Windows however, I am completely clueless how to even begin to get the same kind of information that nm/ldd give me on Linux or even how to get an error message that would at least tell me which damn (pardon my French) dll can not be found ...
Do note however that such answers as: "install precompiled through pip, conda, anaconda" and the like are not what I'm after (hence why the million answers on stackoverflow did not help me).