Skip to content
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 #978

Open
qiaoqiaobangya opened this issue Apr 28, 2024 · 2 comments
Open

ImportError: DLL load failed while importing cv2 #978

qiaoqiaobangya opened this issue Apr 28, 2024 · 2 comments

Comments

@qiaoqiaobangya
Copy link

I have a problem "ImportError: DLL load failed while importing cv2: The specified module could not be found"

Information about my attempted installation
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
MSVC: Microsoft Visual Studio 2019
OS: Win 10
CMake gui: 3.29.2
Source cv2 files version: 4.5.0

I'm compiling opencv from source and it's all working fine, but when instantiating cv2, I get the "Import DLL .... " error occurred.
Python 3.8.10 opencv 4.5.0 opencv_contrib-4.5.0

What is the DLL file that failed to load? Why is this happening?
Also I would like to know if it is possible to make opencv implement CUDA acceleration by compiling opencv source code in the python case. If it is possible how to implement it?

Thank you,
Anthony of Sydney

@asmorkalov
Copy link
Collaborator

The provided information is not enough to debug the issue. Two instances of OpenCV package may cause dll mix. Please ensure that you remove the first instance, when tries another one.

@asmorkalov
Copy link
Collaborator

You case also trace OpenCV loading process by setting sys.OpenCV_LOADER_DEBUG = 1 before OpenCV import.

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

No branches or pull requests

2 participants