Can't import cv2; "DLL load failed"

In my situation, when using Pycharm to import cv2, it returned ImportError: DLL not found. However, using python intepreter to import I got *ImportError: ... not a win32 DLL ... * instead. So, in this situation, I had to download Visual C++ 2015 redistribution package and problem solved.

So to anyone who meets the same error, please make sure you have the VC++ redistribution package which was used to compile the DLL packed along the module.


I had the error with Python 3.4 and opencv-python 3.3 on Windows 10. In my case the problem was due to my Anaconda distribution. I solved it with the solution from the opencv-python project page, which points to this github issue.

The problem is a missing python3.dll in the anaconda distribution. You can download the python binaries here and extract dll out of the zip archive. Put it in a folder in your PATH (e.g. C:\Users\MyName\Anaconda3) and the import should work.


This worked for me:

pip install opencv-contrib-python

(Running Python 3.6.3 - 32bit, on Windows 7 - 64bit)