Skip to content

DLL Dependencies fail in virtual environment #27

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
FlorinSchwappach opened this issue Mar 6, 2017 · 4 comments
Closed

DLL Dependencies fail in virtual environment #27

FlorinSchwappach opened this issue Mar 6, 2017 · 4 comments

Comments

@FlorinSchwappach
Copy link

First of all, thanks a lot for the work on this distribution, it has been very helpful so far!

I have been running opencv-python on a win10/x64 device with python 2.7 and 3.6 successfully. Now, I wanted to use it on a new device, also win10/x64. I've installed it through the PyCharm-GUI, in a fresh virtualenv with python 3.6. Same simple process as my other device.

When I want to import cv2, I get the error "ImportError: DLL load failed (...)". Using find_module(), the correct path to the folder cv2 in site-packages is returned. But during interpretation of init.py, the "from . import cv2" line fails.

I have checked dependencies with dependencywalker, and I have scanned for broken dlls. I have all Redistributable packages since 2010 installed (2010, 2012, 2013, 2015). I also reinstalled all those once already.

I have tried copying around cv2.pyd. At one point, the error message changed: When I used a x86 file, I got the (expected) error message "Not a win32 ...". So the pyd is found by python, but for some reason, loading it fails.

A seemingly identical setup (at least concerning the virtualenv) works on one device and not on another. Do you have a clue what could be missing?

@skvark
Copy link
Member

skvark commented Mar 6, 2017

Does the import work in virtual environments on that other device? You could try just pure python virtual env (or just global installation) on command line without the PyCharm. If it works, PyCharm does something differently.

Also check that you have all the latest Windows updates installed.

@skvark
Copy link
Member

skvark commented Mar 31, 2017

Closing this for inactivity. Please reopen if this is still a problem for you or if you can provide more details.

@skvark skvark closed this as completed Mar 31, 2017
@roachsinai
Copy link

DLL load failed error when importing cv2 on Windows10 + Python3.7. A method to solve the problem is install opencv-contrib-python. I installed by pip pip install opencv-contrib-python, find the solution from here.

@ghost
Copy link

ghost commented Nov 28, 2018

I am getting import error in Windows 10, Python 3.5.4 and Virtual Environment

`ActivePython 3.5.4.3504 (ActiveState Software Inc.) based on
Python 3.5.4 (default, Dec 15 2017, 14:24:56) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import cv2
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Yajana\Documents\Python\mechine_learning\env\lib\site-packages\cv2_init_.py", line 3, in
from .cv2 import *
ImportError: DLL load failed: The specified module could not be found.`

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

3 participants