At my Wit's End with OpenCV Build from Source, Please Help.
Hey all,
As the title says, I'm getting increasingly annoyed with building opencv from source. I can't just use a python wheel as I require gstreamer support, so it seems the only way to do this is build from source.
The error I'm getting is: "ImportError: DLL load failed while importing cv2: The specified module could not be found." when I try to importcv2.
I've googled the error, taken steps that have been recommended there (see below), but nothing seems to work.
Steps I've taken: 1. Downloaded the opencv 4.40 binary, have also tried with 4.50. Generated with CMAKE using correct paths to python installation, include dirs, library etc. 2. Built and installed in VS2019 in Release Mode for x64. 3. Copied cv2.pyd to my Python38/Lib/site-packages directory.
Attempts to Resolve:
Built from a wheel and then uninstalled wheel to get dll files required, no avail. Installed and uninstalled opencv-python with pip to get dll files, no avail.
- Checked with DependencyWalker, saw opencv450_world.dll was missing,tracked it down inopencv/build/x64/vc15/bin and copied it to Python38/DLL, and failing that, site-packages.
- Copied init.py, configure.py and
configure_load.py to
site-packages, resulted in recursion error. - Tried with python 2.7, same error.
- Tried a clean install of both
python versions then repeating steps above, no avail. - Tried different versions of opencv, 4.50 and 4.10, no avail.
Any other suggestions? I'd be happy to pull more logs if you'd like. However, the CMake and VS processes run without a hitch.
Seriously, thanks so much in advance.
Kind Regards, Shrinjay