"DLL load failed" when import cv2 (opencv)

Neo Anderson

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

pip install opencv-contrib-python

installed without any error .
and when I try to import it

import cv2

show me this error :

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.

and I see another topic about this error but their solution does not work for me :
- DLL load failed error when importing cv2
- Failure to import cv2 in python : DLL load failed
- and a lot of pages in here

some of them say about that problem because anaconda, and I don't have anaconda even. and many say that problem 32 or 64 version, I try both and disappointment. many about system variables...
what dll failed to load? cv2? why?

what i try till now:

  • change python version : 3.5, 3.7, 2.7 in 86x and 64x (uninstall complete last version and delete all remain files in program files ... then install new one)

  • try with another packages like : opencv-python, opencv-contrib, try install specific versions with .whl (in some topic i read about this so install numpy-1.14.5+mkl-cp37-cp37m-win_amd64.whl and opencv_python-3.4.3+contrib-cp37-cp37m-win_amd64.whl but anything not change)

  • import numpy before cv2 for every test

  • installed Microsoft Visual C++ 2015 Redistributable Update 3 , 2008 , 2010 , 2017 for 64x

UPDATE
NEXT 2 DAY

I try to manage missing dll base on dependency walker that mention in bellow post, download all dll and put them in system 32, its a good clue but not solve the problem.

DAY 4,5

my next step , trying compile OpenCV in my machine , install visual studio 2012 + cmake and base on document compile 2 version , 64x and 32 , compiling have a lot of problem itself (like missing some lib from c lang and need to install Visual C++ Redistributable for Visual Studio 2012 ...) and I resolve all of them ,then I have 2 success compiled version but both have the same problem with missing dll, the compile process is so slow and give 2 day from me. so if fail on this mission :/ I search for a new way...

DAY 6

my next step is to try to run OpenCV in my machine with docker ( I try but docker windows just install on windows 10 and windows server 2016) so I search for an alternative. I found Vagrant that work like docker but with VM (visual box) today my time spend for this articles, it's amazing, the concept of docker and vagrant is so Attractive, and I play with this like that I have new puzzle :) first error show on ... and limitless errors go on :

Day 7

Vagrant tests failed too because my windows server 2012 is a vb machine (visual server) and run a visual box in another visual box impossible! so I need new clues :

Day 8-9

try install vagrant with VMware , I download VMware, unfortunately this plugin is not free (79$) so I try to work with pythonanywhere.com that 'gives you access to machines with a full Python environment already installed.' in this free account, you can't openurl with urllib , and more limit... so I wanna try to install ubuntu in VMware my self... I read here results after work. it's Impossible with same reason vb (visual box)

anand_v.singh

This can happen if you are using windows 10 N distribution, the N distributions does not come pre installed with windows media feature pack, which is required after OpenCV version 3.4 and onwards.

The preferred solution is to install the feature pack at : https://www.microsoft.com/en-us/software-download/mediafeaturepack

Be careful to choose the version that works with your current version of windows.

If that is not an option, fall back to an earlier version of OpenCV that does not have dll dependencies, you can do that by:pip install opencv-python=3.3.0.9

Since windows rolled out it's N version this problem has been seen at many places, and has many impacts across the windows environment, the fastest way to identify if you have this problem is open youtube in Edge browser, if it says HTML5 media plugin not found, this is the problem.

Update May 2020: There is a new way to install media pack for Windows 10 N.

https://support.microsoft.com/en-us/help/4562569/media-feature-pack-for-windows-10-n-may-2020

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Can't import cv2; "DLL load failed"

From Java

DLL load failed error when importing cv2

From Dev

Tensorflow (1.13.1) Exception when import: DLL load failed (Windows 10)

From Dev

Error when trying to import sklearn modules : ImportError: DLL load failed: The specified module could not be found

From Dev

Import Error: DLL load failed: The specified module could not be found when using cxfreeze

From Dev

ver.2 PyGreSQL ERROR: from _pg import * ImportError: DLL load failed: The specified module could not be found

From Dev

import QCustomPlot2 ImportError: DLL load failed: The specified procedure could not be found

From Dev

Python Opencv DLL load failed - Windows 10

From Dev

Can't import Orekit - 'DLL load failed'

From Dev

python tensorflow import dll load failed

From Dev

DLL load failed when importing PySide2, only while debugging

From Dev

"ImportError: DLL load failed" when importing tensorflow

From Java

import opencv vs import cv2

From Dev

QScintilla2 not installed DLL load failed

From Dev

CV2: Import Error in Python OpenCV

From Dev

Opencv 3.1.0 with extra modules throws DLL load failed error

From Dev

PyQt5 pyuic Import error: DLL load failed

From Java

Import error: DLL load failed in Jupyter notebook but working in .py file

From Dev

Pyinstaller: Import Error: DLL load failed: The specified module could not be found

From Dev

importError: DLL load failed(import h5py)

From Java

DLL load failed when importing PyQt5

From Dev

DLL load failed when importing TensorFlow with GPU support

From Dev

PySide2: DLL load failed: The specified procedure could not be found

From Dev

Issue installing OpenCV 4.1.2 on Jetson Nano. import cv2, No module named 'cv2'

From Dev

how to install openCV_python with no import cv2 error?

From Dev

Error trying to import cv2(opencv-python) package

From Dev

opencv 3.0.0 alpha with Python 3 failed to import cv2

From Java

"import torch" giving error "from torch._C import *, DLL load failed: The specified module could not be found"

From Dev

import matplotlib._png as _png Import: Error: DLL load failed: The specified module could not be found

Related Related

  1. 1

    Can't import cv2; "DLL load failed"

  2. 2

    DLL load failed error when importing cv2

  3. 3

    Tensorflow (1.13.1) Exception when import: DLL load failed (Windows 10)

  4. 4

    Error when trying to import sklearn modules : ImportError: DLL load failed: The specified module could not be found

  5. 5

    Import Error: DLL load failed: The specified module could not be found when using cxfreeze

  6. 6

    ver.2 PyGreSQL ERROR: from _pg import * ImportError: DLL load failed: The specified module could not be found

  7. 7

    import QCustomPlot2 ImportError: DLL load failed: The specified procedure could not be found

  8. 8

    Python Opencv DLL load failed - Windows 10

  9. 9

    Can't import Orekit - 'DLL load failed'

  10. 10

    python tensorflow import dll load failed

  11. 11

    DLL load failed when importing PySide2, only while debugging

  12. 12

    "ImportError: DLL load failed" when importing tensorflow

  13. 13

    import opencv vs import cv2

  14. 14

    QScintilla2 not installed DLL load failed

  15. 15

    CV2: Import Error in Python OpenCV

  16. 16

    Opencv 3.1.0 with extra modules throws DLL load failed error

  17. 17

    PyQt5 pyuic Import error: DLL load failed

  18. 18

    Import error: DLL load failed in Jupyter notebook but working in .py file

  19. 19

    Pyinstaller: Import Error: DLL load failed: The specified module could not be found

  20. 20

    importError: DLL load failed(import h5py)

  21. 21

    DLL load failed when importing PyQt5

  22. 22

    DLL load failed when importing TensorFlow with GPU support

  23. 23

    PySide2: DLL load failed: The specified procedure could not be found

  24. 24

    Issue installing OpenCV 4.1.2 on Jetson Nano. import cv2, No module named 'cv2'

  25. 25

    how to install openCV_python with no import cv2 error?

  26. 26

    Error trying to import cv2(opencv-python) package

  27. 27

    opencv 3.0.0 alpha with Python 3 failed to import cv2

  28. 28

    "import torch" giving error "from torch._C import *, DLL load failed: The specified module could not be found"

  29. 29

    import matplotlib._png as _png Import: Error: DLL load failed: The specified module could not be found

HotTag

Archive