“DLL load failed” when import cv2 (opencv)

前端 未结 15 1107
萌比男神i
萌比男神i 2020-12-14 08:45

In [windows server 2012 R2 x64, python 3.7 64x]

pip install opencv-contrib-python

installed without any error .
and when I try to impor

15条回答
  •  我在风中等你
    2020-12-14 09:16

    i was suffering from the same problem "DLL load failed" after reading tons of answers and articles i got a solution.

    i don't know this works for you or not but give it a try.

    tools and versions i used: anaconda - 5.3.1, python - 3.7, win 10 (64 bit)

    Steps i performed :

    step1:i installed opencv 3.4.4 from here then extract into C drive (you can do wherever you want)

    step2: copy cv2.pyd file from [C:\opencv\build\python\cv2\python-3.7] here to [C:\Users\"user-name"\Anaconda3\Lib\site-packages] here.

    step3: run dependency walker to detect which dll files are missing, after running dependency walker in my case it showed two dll files are not loading, they are (1)OPENCV_WORLD344.DLL and (2)IESHIMS.DLL. i don't know about your situation but you can do this-> find files name using dependency walker then find their path and follow step4.

    step4: open System property->Advanced->Environment variables, now edit path and add C:\opencv\build\x64\vc14\bin (in my case this was the place where OPENCV_WORLD344.DLL is stored) and after doing this, import cv2 in python.

    If my answer does not work then add a comment.

提交回复
热议问题