0

I am trying to install opencv on my laptop but I keep getting ImportError: DLL load failed while importing cv2: The specified module could not be found.
I tried installing installing with conda install -c conda-forge opencv in an anaconda env.
But I also get the same result if I use my normal python 3.10 interpreter with opencv-python and opencv-contrib-python.
I also tried to compile the module myself but cv2.cp310-win_amd64 gives me the same error as well...

Isnt there just an prebuild binary I can use? or should I look for an different ML module?

Yesterday when I came home I tried installing opencv-python on my personal computer. And it worked instantly. I have an GTX 1070 in that pc and an RTX A1000 in the work laptop I need opencv on. So I tought that the cuda cores might not be supported or something.
I found this tutorial https://machinelearningprojects.net/build-opencv-with-cuda-and-cudnn/
But after installing the Nvidia SDK, cudnn and compiling opencv from source I still get the same error.
Even with appending the opencv output folder and the cuda sdk bin folder to python's dll_path.

Disabling BUILD_SHARED_LIBS as suggested in here also does nothing....
https://forum.opencv.org/t/opencv-w-cuda-build-seems-successful-but-import-cv2-fails/11328/3

E_net4
  • 27,810
  • 13
  • 101
  • 139
woldgrep
  • 97
  • 2
  • 12

2 Answers2

0

This happened to me just this morning, and I fixed it by installing opencv using pip. First, I removed conda's opencv installation. In the environment where it is installed type

conda remove opencv

Once it is removed, type

pip install opencv-python

Hope it helps

supvato
  • 33
  • 5
  • sadly it didnt help...... – woldgrep Feb 09 '23 at 15:24
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 11 '23 at 23:22
0

Using python 3.6 with conda install -c conda-forge opencv=3.2.0 as described here OpenCV-Python ImportError: DLL load failed: The specified module could not be found solved the issue on my laptop with an RTX A1000. Weird opencv works with python 3.10 on my desktop with an GTX 1070

woldgrep
  • 97
  • 2
  • 12