DLL load failed error when importing cv2
You can download the latest OpenCV 3.2.0 for Python 3.6 on Windows 32-bit or 64-bit machine, look for file starts withopencv_python‑3.2.0‑cp36‑cp36m
, from this unofficial site. Then type below command to install it:
pip install opencv_python‑3.2.0‑cp36‑cp36m‑win32.whl
(32-bit version)pip install opencv_python‑3.2.0‑cp36‑cp36m‑win_amd64.whl
(64-bit version)
I think it would be easier.
Update on 2017-09-15:
OpenCV 3.3.0
wheel files are now available in the unofficial site and replaced OpenCV 3.2.0
.
Update on 2018-02-15:
OpenCV 3.4.0
wheel files are now available in the unofficial site and replaced OpenCV 3.3.0
.
Update on 2018-06-19:
OpenCV 3.4.1
wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7
support, and replaced OpenCV 3.4.0
.
Update on 2018-10-03:
OpenCV 3.4.3
wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7
support, and replaced OpenCV 3.4.1
.
Update on 2019-01-30:
OpenCV 4.0.1
wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7
support.
Update on 2019-06-10:
OpenCV 3.4.6
and OpenCV 4.1.0
wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7
support.
If you are using Anaconda with python 3.5
, this is a problem in the Anaconda release. (Refer this issue)
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
, typepython --version
to find whether your installation is 64-bit or 32-bit - download python 3.x embeddable zip file from here
- Extract the zip file and copy
python3.dll
file toAnaconda3
folder
But if you can move to Anaconda
with python 3.6
you will not face this issue. If it is possible for you, then it is the recommended way..