Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Nov 28, 2018 · 4 comments
Closed

Comments

@ghost
Copy link

ghost commented Nov 28, 2018

I have installed opencv using pip install opencv-contrib-python in ActivePython 3.5.4 in ** Windows 10**. When I import cv2 module it is throwing error as
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Yajana\Documents\Python\mechine_learning\env\lib\site-packages\cv2\__init__.py", line 3, in <module> from .cv2 import * ImportError: DLL load failed: The specified module could not be found.

  1. I have Microsoft Visual C++ 2015 Redistributable Installed
  2. I have tried with downloading api-ms-win-downlevel-shlwapi-l1-1-0.dll and placing it in system32 and SysWOW64

What else can be done to resolve the issue?

@skvark
Copy link
Member

skvark commented Nov 28, 2018

These packages are targeted only for the official CPython implementation: https://www.python.org/

Please do not download arbitrary DLL files from the internet. They might contain malware.

First, install all Windows updates to your system. If that does not work, you can try to check the missing dependencies with Dependency Walker.

@ghost
Copy link
Author

ghost commented Nov 28, 2018

  1. I have tried with official CPython also getting the same error.
  2. Windows is up to date.
  3. In Dependency Walker when I open cv2.cp35-win_amd64.pyd the log is
    Error: At least one required implicit or forwarded dependency was not found. Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module. Error: A circular dependency was detected. Warning: At least one delay-load dependency module was not found. Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

Missing dlls are
API-MS-WIN-*.DLL
EXT-MS-*.DLL
EMCLIENT.DLL
EXT-MS-WIN-*.DLL
MF.DLL
MFPLAT.DLL
MFREADWRITE.DLL

Here are the logs when I import in -v mode

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 697, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "C:\Users\Yajana\Documents\Python\mechine_learning\env\lib\site-packages\cv2\__init__.py", line 3, in <module>
from .cv2 import *
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 577, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 938, in create_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

@skvark
Copy link
Member

skvark commented Nov 28, 2018

Could you try with https://github.com/lucasg/Dependencies. Its output is easier to read as it does not contain so many false positives.

@ghost
Copy link
Author

ghost commented Dec 5, 2018

The solution for this issue is to download windows media feature package for the version of windows that I am using.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant