How to remove the error : "ImportError: DLL load failed: The specified module could not be found." while importing cv2 in jupyter notebook

Viewed 246

I have already installed opencv-python by

pip install opencv-contrib-python

I also have python 3.7.2 installed on my device(Windows 10)

On importing cv2, this shows up:

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

I have even checked for python3.dll file in anaconda3, folder it's there.

Please suggest some way to successfully import it.

1 Answers

Assuming you really need the contrib module, for the error you specified,

try this:

1. make sure you have Visual C++ redistributable 2015 installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, Universal C Runtime might be also required.

Contrib document on pip clearly mentions this to be installed as a prerequisite.

2. If you still encounter the error after you have checked all the previous solutions, download Dependencies and open the cv2.pyd (located usually at C:\Users\username\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\cv2) file with it to debug missing DLL issues.

Dependencies.

Use the second solution if fails again.

Post me on the comment section if it works and accept this as a solution or otherwise let me know.

Related