-
Notifications
You must be signed in to change notification settings - Fork 870
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
ImportError: DLL load failed while importing cv2: The specified module could not be found. #856
Comments
I have exactly this issue. |
After some investigation I see it fails on init.py in the cv2 folder on the line native_module = importlib.import_module("cv2") |
Is there a solution to this? |
Same problem, is there a solution ? |
The instructions are a little out of date, but I believe they would solve the issue |
@GenericAccount2 This was the solution. Thank you. |
I think that OpenCV should consider updating their documentation. |
No idea which documentation you want to read. https://pypi.org/project/opencv-python/
And this is a copy of top level README of this project: |
In your Python environment, execute this code and install the required packages. |
Trying to run https://github.com/cudawarped/opencv-python-cuda-wheels on python 3.11 on Windows Server compiled by @cudawarped and getting import DLL error. All DLLs seem to be there. Not an issue when using python 3.7 on the same system. |
This is not an officially supported release. Please raise an issue on that repo with more details regarding your setup and which wheel you are using and I'll take a look. |
@cudawarped solved as part of: #955 |
Use process monitor to track down the missing dll. See ImportError: DLL load failed while importing cv2: The specified module could not be found |
I got the same problem. |
I have the same problem (Python 3.11) |
@jason660519 and @fluviotect when you ran process monitor which dll's couldn't it find? |
At least for me the issue seems to be |
@catequalsgood I am presuming you are using a script to parse the process monitor output which is how you managed to filter it down to only those two entries, making the result extreemly odd. Specifically I can't understand why python would be outputing an error that it can't find all the dll's when it has found them. |
I was not using a script but I changed that and looked at the log again. I did indeed miss one. |
You may find it much easier to parse the exported list, see https://forum.opencv.org/t/dll-load-failed-when-importing-a-self-built-cv2-library-in-python/16942/15 |
The output seems equivalent. More DLLs like |
this is such a growing issue.. I am unable to import cv2 for days and my whole project is stuck! |
@SubhamBurnwal-BiswaGames Did you build it yourself? If so did you check for the missing dll using process explorer and if so what was missing? |
I too was facing the same issue. I have python 3.11.7 in my conda env and I used conda to install opencv and I faced the same import error. I reinstalled the Visual C++ redistributables, checked if opencv package was present in anaconda and even then I couldn't solve the issue. Then I noticed that conda by default installs opencv 4.7 and the lastest version was opencv 4.9. So I used pip to install the latest release of opencv 4.8.1.78 and now I can import the cv2 module successfully. |
For me, gstream runtime dll are not in site-packages\cv2 folder. I'm using the way mentioned at here:, i.e. add following before import cv2: |
I used Anaconda Navigator to install opencv and got version 4.6.6. Then I had this "DLL load failed while importing cv2" issue. I tried to use "Process Monitor" suggested by other link and found that "intl.dll" was not found. After seeing Raknash3's comment, I removed the opencv with Anaconda Navigator and tried "conda install -c conda-forge open.cv" and had 4.7.0 installed. Now it works. Thanks. |
encountered this error on Windows 11 Enterprise N. To fix it, I installed the Media Feature Pack by going to Settings > System > Optional Features > Add an Optional Feature. If the issue persists after installing the Media Feature Pack, try reinstalling OpenCV." |
Hi,
I installed opencv-contrib-python 4.7.0.72 using pip for python 3.11.4 on Windows 10 x86-64
But when I run I get this exceptiom
DLL load failed while importing cv2: The specified module could not be found.
Expected behaviour
I expect the module to import and not trow an error.
Actual behaviour
This exception gets trown
Steps to reproduce
import cv2
Windows 10, i7-12700H with Intel Iris Xe Graphics and a NVIDIA RTX A1000
x86-64
opencv-contrib-python-4.7.0.72
Issue submission checklist
opencv-python
The text was updated successfully, but these errors were encountered: