In [windows server 2012 R2 x64, python 3.7 64x]
pip install opencv-contrib-python
installed without any error .
and when I try to impor
i was suffering from the same problem "DLL load failed" after reading tons of answers and articles i got a solution.
i don't know this works for you or not but give it a try.
tools and versions i used: anaconda - 5.3.1, python - 3.7, win 10 (64 bit)
Steps i performed :
step1:i installed opencv 3.4.4 from here then extract into C drive (you can do wherever you want)
step2: copy cv2.pyd file from [C:\opencv\build\python\cv2\python-3.7] here to [C:\Users\"user-name"\Anaconda3\Lib\site-packages] here.
step3: run dependency walker to detect which dll files are missing, after running dependency walker in my case it showed two dll files are not loading, they are (1)OPENCV_WORLD344.DLL and (2)IESHIMS.DLL. i don't know about your situation but you can do this-> find files name using dependency walker then find their path and follow step4.
step4: open System property->Advanced->Environment variables, now edit path and add C:\opencv\build\x64\vc14\bin (in my case this was the place where OPENCV_WORLD344.DLL is stored) and after doing this, import cv2 in python.
If my answer does not work then add a comment.
I was having the same issue. I resolved this error by downgrading open cv.
pip install opencv-python==3.3.0.9
I was having this problem on Windows Server 2008R2 fresh install and took almost a day to resolve, as was trying with many hits and trials finally I found solution somewhere in internet (not stackoverflow)
Besides check list includes
Hopefully its will help save time
its worked well for me.* Answer is Need to put cv2.pyd file to your virtual environment. need to put under two folder of envs,
To get cv2.pyd > download from this link https://sourceforge.net/projects/opencvlibrary/ and then extract the download file
You will get opencv folder, after that go inside opencv folder like Downloads\opencv\build\python\2.7 and go one deeper folder depend on your 32 or 64 window version
Copy cv2.pyd Important **** after copying cv2.pyd file to your envs, you need to rename cv2.pyd to _cv2.pyd
Python 3.7 may not support some modules.
All you need is python 3.6.
I've been looking for solution for last 3 days and my problem was solved when i installed python 3.6.7.
After installing python 3.6 you can simply run pip install opencv-python
.
Source: https://www.geeksforgeeks.org/setup-opencv-with-pycharm-environment/