Ask Your Question
0

Python - Failure to import cv2: DLL load failed

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

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

Comments

Are you limited in using 3.2.0? If no I suggest to try prebuilt wheels: http://www.lfd.uci.edu/~gohlke/python...

electron gravatar imageelectron ( 2017-05-22 12:20:34 -0600 )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 -0600 )edit

How to run your file?

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

download wheel and install it using pip: pip install path_to_wheel

electron gravatar imageelectron ( 2017-05-23 09:59:47 -0600 )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 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

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

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
0

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

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

edit flag offensive delete link more

Comments

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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 9,832 times

Last updated: Jul 01 '18