OpenCV-Python ImportError: DLL load failed: The specified module could not be found

Asked
Active3 hr before
Viewed126 times

6 Answers

specifiedmodulefoundimporterrorfailedpython
90%

Jan 12, 2021 - I reinstalled Python to have a clean setup again,Which directory containing the opencv dll’s did you add to your path bin or install\x64\vc16\bin?,Windows Environment – Path,Failing that try anaconda and dload the binaries from

Example_snippet/controller/utility/_specified.js/ Python 3.8.6 (tags/v3.8.6:db45. . .
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 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:\DevHome\Program\OpenCV450\build\python_loader\cv2\__init__.py", line 96, in <module>
         bootstrap()
         File "C:\DevHome\Program\OpenCV450\build\python_loader\cv2\__init__.py", line 86, in bootstrap
         import cv2
         ImportError: DLL load failed while importing cv2: The specified module could not be found.
load more v
88%

It says cv2 doesn't work with python 3 I was wondering if this has been fixed or if there is a way around it,This is the only way I could get cv2 to work and I tried everything for two days,,I could import opencv no problem when I launched python from the command line

Example_snippet/controller/utility/_specified.js/ pip install opencv-contrib-pyt. . .
pip install opencv - contrib - python
load more v
72%

I have looked at other posts in regards "ImportError: DLL load failed while importing cv2: The specified module could not be found" and they were to no avail,,I am still having the ImportError: DLL load failed while importing cv2: The specified module could not be found,I am facing the exactly same problem as you and Laurent, but I still have no clues what is going on

Example_snippet/controller/utility/_specified.js/ CMake Warning at cmake/OpenCVG. . .
CMake Warning at cmake / OpenCVGenSetupVars.cmake: 54(message):
   CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
directory
Call Stack(most recent call first):
   CMakeLists.txt: 1010(include)
load more v
65%

pip install opencv-python==3,3

Example_snippet/controller/utility/_specified.js/ pip install opencv-contrib-pyt. . .
pip install opencv - contrib - python
Step 2 continued with import cv2 . . .
import cv2
Step 3 continued with Traceback (most recent call la. . .
Traceback (most recent call last):
File "test.py", line 1, in <module>
   import cv2
   File "C:\Program Files\Python37\lib\site-packages\cv2\__init__.py", line 3, in
   <module>
      from .cv2 import *
      ImportError: DLL load failed: The specified module could not be found.
load more v
75%

Same thing happens, That’s why I originally added the choco install and ENVARS

Example_snippet/controller/utility/_module.js/ ImportError while importing te. . .
ImportError while importing test module
'C:\Users\travis\build\samclane\Discordia\Discordia\test\test_all.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
Discordia\test\test_all.py:14: in <module>
   from Discordia.Interface.Rendering.DesktopApp import MainWindow
   Discordia\Interface\Rendering\DesktopApp.py:12: in <module>
      import pixelhouse as ph
      c:\python37\lib\site-packages\pixelhouse\__init__.py:2: in <module>
         from .canvas import Canvas, load
         c:\python37\lib\site-packages\pixelhouse\canvas.py:2: in <module>
            import cv2
            c:\python37\lib\site-packages\cv2\__init__.py:3: in <module>
               from .cv2 import *
               E ImportError: DLL load failed: The specified module could not be found.
load more v
40%

Today, when I typed import cv2, I was given this error message: ImportError: DLL load failed: The specified module could not be found, ,When I use dependency walker, I saw the same list of missing dlls as reported [here]

Example_snippet/controller/utility/_module.js/ cmake -DBUILD_SHARED_LIBS=OFF . . .
cmake - DBUILD_SHARED_LIBS = OFF