I had the same problem and spent 3 full days wrestling with it. I tried everything suggested: upgrading pip, updating Visual C++, updating Anaconda, manually downloading files and basically every solution I could find on the web. Here's what finally worked maybe it'll help someone else:
1- I ditched Python 3 and Anaconda-based downloads since I noticed they had several problems and downloaded Python 2.7.16 64-bits instead.
2- Navigated to where Pip was located on my drive (for me the path is C:\Python27\Scripts) highlighted the path by selecting it, and typed "cmd" then enter so the Command Prompt opens on that path (I noticed skipping this usually brings about a couple errors)
3- Updated Pip using python -m pip install --upgrade pip
on the CMD (again, skipping this and not updating it didn't let this procedure go through)
4- Downloaded the appropriate Wheel
file from https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv (after trying several the one that worked for me was opencv_python-2.4.13.7-cp27-cp27m-win_amd64.whl) I copy-pasted it to the same folder Pip was in (C:\Python27\Scripts for me) and then installed it through CMD using: pip install opencv_python-2.4.13.7-cp27-cp27m-win_amd64.whl
. Always through CMD opened on that path as showed in step 2
5- After step 4 when I imported OpenCV using import cv2
I didn't have the DLL error anymore but an error related to numpy (since I had just installed that version of Python and so Numpy wasn't installed yet). I installed numpy by typing pip install numpy
and voilà ! The problem was solved and OpenCV imported correctly.
Hope this helps someone.
pip install opencv-python
should work. I am using python38. – Cyrenaica