I have been looking for a solution for several days and could not find one for the following error:
Blockquote
Traceback (most recent call last):
File “<pyshell#0>”, line 1, in
import cv2
File “C:\Python\lib\site-packages\cv2_init_.py”, line 181, in
bootstrap()
File “C:\Python\lib\site-packages\cv2_init_.py”, line 153, in bootstrap
native_module = importlib.import_module(“cv2”)
File “C:\Python\lib\importlib_init_.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed while importing cv2: Das angegebene Modul wurde nicht gefunden. <
I can’t figure out what is causing this.
If I install this via PIP, opencv works without problems, only then without CUDA. What I would like to change.
When creating everything went through without problems, even with cmake.
Therefore, I am now at the end where I should still look for the error.
Does anyone have tips on what you could check everything?
Or even a solution for?
If that doesn’t work then you can track down the dll using process monitor by filtering for
Process Name = python.exe
Operation = Create File
and looking for the dll which eventually fails. But if you are not familiar with the tool its better to verify the paths above first in case that works.
Alternatively if you are using CUDA 11.7 you could try installing this pre-built wheel after first making sure you have uninstalled all existing OpenCV wheels and deleted all files copied accross to Lib/site-packages (cv2 folder) when you built/installed OpenCv from source.
With the Process Monitor I was able to find the missing dll. It was the CUDNN file that was missing, so nothing worked for me. Copied all DLL’s where there was a problem into the CV2 folder under site-packgase and the last DLL then brought the solution.