Aj_kumar
Aj_kumar

Reputation: 11

DLL load failed: The specified module could not be found

I have installed Python 3.6.4. When I import cv2, it throws this error:

DLL load failed: The specified module could not be found.

I have OpenCV version 2.4.13.

What should i do?

Upvotes: 0

Views: 4958

Answers (4)

anand_v.singh
anand_v.singh

Reputation: 2838

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

If the problem still persists try using Dependency walker to find out where specifically your problems stem from and then try fixing them individually.

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.

Upvotes: 0

Kino
Kino

Reputation: 1

In my situation,

ImportError Traceback (most recent call last)

in ()

10 import os.path

11 from keras.models import load_model

---> 12 import cv2

13 from utils.utils import get_yolo_boxes, makedirs

14 from PIL import Image

ImportError: DLL load failed: The specified module could not be found.


Face this ImportError in the pass week, and I solved with enter below scripts in the Anaconda Prompt.

conda install -c menpo opencv

And here is my environment:

Python 3.6.5 Anaconda

Keras 2.2.2

tensorflow 1.9.0

For more details, here is the log I tried to solved this ImportError: micky619/holiday-similarity#3

Upvotes: 0

JJ Jr.
JJ Jr.

Reputation: 1

Try doing this:

  1. Go to command prompt and "cd" the directory of python.

  2. Enter this if you are running Python 3.x.x

    pip3 install opencv-python
    

    OR

    2.If on Python 2.x.x

    pip2 install opencv-python
    

DO NOT USE:

 pip install opencv

That was my mistake and had to dig a lot to find a solution.

Upvotes: 0

hikerjobs
hikerjobs

Reputation: 386

It's possible that you have Python 2 and 3 installed and Python 3 doesn't know about your opencv installation. Try this:

pip3 install opencv-python

That will install opencv for Python 3 and hopefully that fixes your problem.

Upvotes: 1

Related Questions