-
Notifications
You must be signed in to change notification settings - Fork 860
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
DLL load fails on Anaconda/Windows install (python3.dll) #36
Comments
Thanks, that's a really good and detailed report. I'll add a mention about the dependency to the README. What comes to Anaconda support in general, these packages are targeted only for the original CPython. They may work with other distributions, but it's better to use for example Anaconda's package management system to install packages for that distribution. Personally I like to use official Python versions because many of the scientific packages can be nowadays found (except SciPy's Windows builds) as precompiled wheels from PyPI. This was not true few years back but the situation is getting better. It would be nice if we had all packages available in PyPI but I guess it's not yet possible. Some of the packaging work is done currently twice (like the menpo/opencv3 package) so the situation is a bit suboptimal as the people who are willing to do this work are somewhat rare in the open source world. |
I am having this same issue. I just updated the visual studio but that didn't fix it :( |
Well, as @talmo wrote above, the issue is in Anaconda. The linkage rules in PEP 384 clearly state that under Windows applications are linked with python3.dll. You just have to download the correct python3.dll and place it manually to path until Anaconda provides a fix for this. |
do you mean the anaconda path or the open cv path? @skvark |
I think any place that is in the PATH environment variable should be enough. For example |
@skvark now I get |
As the error says, you have probably downloaded a 64-bit version while your installation is 32-bit. |
I have the 64 windows. Do you mean my python installation? |
Yes, I mean Python installation. Please ask this kind of questions in the future for example in Stackoverflow or in some other QA forum. |
Yea kinda got out of hand. Sorry for that. Do hope this dialogue would be helpful to at least 1 other person. |
Thanks, this helped a lot! |
Thanks, finally got it working! |
Thank you . Awesome explanation. I was able to resolve it. @talmo |
Perfect! Successfully solved my problem. |
i meet the same problem, and i solve it from stackoverflow: https://stackoverflow.com/questions/43184887/dll-load-failed-error-when-importing-cv2
You can fix this issue by copying python3.dll file to Anaconda3 folder (where python.exe is located) How to get "python3.dll" In cmd, type python --version to find whether your installation is 64-bit or 32-bit |
The latest Anaconda releases include |
Thank you! It solves my case. |
thanks,it really helps me!! |
For my case, there is already python3.dll in Anaconda3 file. Still, there is the importerror for cv2. The version of Anaconda is 64 bits, the installed python in Anaconda is 32 bits, I wonder if this kind of version mismatch cause the import error? BTW, other packages such keras and numpy work well. |
I have no idea about Anaconda or how it works internally. I presume you are using Windows? Check the FAQ in readme: https://github.com/skvark/opencv-python#frequently-asked-questions How did you install Also, what's the exact error? If the error is the same as in this issue, then check the |
Thank you very much. Yes, it's on Windows. And the method in this website solved my problem. https://www.scivision.co/install-opencv-python-windows/ Previously, I installed opencv using |
Then your issue had nothing to do with opencv-python or this repository. Please report conda issues to conda repositories in the future. |
I'm using win7. |
Sounds like you're not using opencv-python ( |
use conda update -all to get a stable environment. Then everything will be alright. |
I install a totally new windows 7 system,and I encountered the same problem as well.Then I find the dll below in other machine ,put it into C:\Windows\System32, and I solve the import cv2 problem. |
It works well on windows 7.Thanks! @kenliang18 |
@kenliang18 thanks! it worked for me too, and i just push it into C:\Windows\System32 without running command regsvr32 api-ms-win-downlevel-shlwapi-l1-1-0.dll |
After doing a simple
pip install opencv-python
orpip install opencv-contrib-python
and trying to import the library, I ran into this issue:The readme suggests installing the Visual C++ Redistributable for Visual Studio 2015
but I already had it installed (actually had Visual Studio itself installed as well).
Checking the dependencies of the pyd binary in this package (using dumpbin which comes with Visual Studio):
After checking if these were in the PATH I was surprised to find that
python3.dll
was the only one that wasn't!Although
python3.dll
comes with the standard CPython install, it's not packaged with Anaconda for some reason. ContinuumIO/anaconda-issues#1394 references this and it seems like it's just not supported(?).As a workaround suggested in that thread, I solved this by just copying
python3.dll
from the official CPython 3.5.2 binaries (specifically from the Windows x86-64 embeddable zip file) intoC:\Anaconda3
, although I imagine it would work being anywhere in your PATH.I thought I'd share this bit of troubleshooting since Anaconda is a popular distribution among academics and so is OpenCV, so I figure I might not be the only one running into this issue. Maybe a note in the readme might help others until Anaconda resolves this?
Alternatively, the menpo/opencv3 Anaconda package would also work but I don't think it supports ffmpeg nor opencv-contrib.
For reference, I'm running on Python 3.5.2 which came with Anaconda 4.2.0 (official installer), although
conda info
reports a slightly newer version:Cheers and thanks for all the work you put into this repo!
The text was updated successfully, but these errors were encountered: