-1

i have followed this video for OpenCV installation: https://www.youtube.com/watch?v=5pYh1rFnNZs

Everything is built successfully in CMake, and I built and installed files using Visual Studio 2019 and everything was successful. But at last, when I opened command prompt, I have got this error:

C:\Users\Ganesh Akshaya>python
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python38\lib\site-packages\cv2\__init__.py", line 89, in <module>
    bootstrap()
  File "C:\Python38\lib\site-packages\cv2\__init__.py", line 79, in bootstrap
    import cv2
ImportError: DLL load failed while importing cv2: The specified module could not be found.
>>>
Kevin
  • 16,549
  • 8
  • 60
  • 74
Gana016
  • 31
  • 1
  • 9
  • Have you tried Googling the error? It looks like several other people have had a similar issue, as seen [here](https://stackoverflow.com/q/43184887/3987854). – Kevin Aug 05 '20 at 12:43
  • yeah i couldnt find any solutions even in that page people are installing using pip but here i installed using cmake and visual studio – Gana016 Aug 05 '20 at 12:54
  • i think the problem is with system paths could anyone tell me which system path i had missed ? – Gana016 Aug 05 '20 at 14:08
  • 1
    I would guess: probably the path at which Visual Studio built your cv2 DLLs – Kevin Aug 05 '20 at 14:12
  • could you please tell me where can i find those paths – Gana016 Aug 05 '20 at 14:14
  • 1
    When you build in Visual Studio, the **full** path to the built DLLs is printed in the build window. – Kevin Aug 05 '20 at 14:15
  • i found that dll,s are here in this path: – Gana016 Aug 05 '20 at 14:22
  • C:\opencv\build\install\x64\vc16\bin – Gana016 Aug 05 '20 at 14:22
  • then tried keeping that directory in system path but its of no use the same error is repeating dll is missing! – Gana016 Aug 05 '20 at 14:23
  • seriosuly after 4 hours i found solution from the above mentioned path i copied all the dlls and saw available python paths in my environments and pasted in that python path! everything is set! – Gana016 Aug 05 '20 at 14:49

1 Answers1

1

seriosuly after 4 hours i found solution from the "C:\opencv\build\install\x64\vc16\bin" path i copied all the dlls and saw available python paths in my environments and pasted in that python path "C:\Python38"

Gana016
  • 31
  • 1
  • 9