Ask Your Question

Python - Failure to import cv2: DLL load failed

asked 2017-05-22 02:48:26 -0500

hoang anh tuan gravatar image

I refered to this link. But it did not help me.

I installed python 2.7 and opencv 3.2.0. cv2.pyd exist in the Python34\Lib\site-packages folder. When i run the following code

import cv2

Python shows the above error.

Help me! Thank for supporting!

edit retag flag offensive close merge delete


Are you limited in using 3.2.0? If no I suggest to try prebuilt wheels:

electron gravatar imageelectron ( 2017-05-22 12:20:34 -0500 )edit

@electron: No. I build opencv 3.2.0 normal. Not limit.

hoang anh tuan gravatar imagehoang anh tuan ( 2017-05-22 20:36:07 -0500 )edit

How to run your file?

hoang anh tuan gravatar imagehoang anh tuan ( 2017-05-22 20:36:53 -0500 )edit

download wheel and install it using pip: pip install path_to_wheel

electron gravatar imageelectron ( 2017-05-23 09:59:47 -0500 )edit

btw, seems that you are trying to use in Python37 opencv installed for Python34. Check if you're using correct python versin and make sure that python is in PATH

electron gravatar imageelectron ( 2017-05-23 11:14:07 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2017-05-24 20:55:11 -0500

hoang anh tuan gravatar image

I solved it. My solution is: - Copied all "dll" libraries from release folder to "C:\Python27"

edit flag offensive delete link more

answered 2018-07-01 23:08:01 -0500

Python 3.X or Anaconda users, use the below in the prompt <pip install="" opencv-python="">

edit flag offensive delete link more


I tried this and I got the same error. I am using this on windows and I do not have idea about windows. Do I need to add some path variables?? even for conda environment

Garvita gravatar imageGarvita ( 2018-09-18 11:10:28 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-05-22 02:48:26 -0500

Seen: 7,729 times

Last updated: Jul 01 '18