I\'ve been trying to install both OpenCV and cv2 from both Pycharm and from the terminal as suggested using:
pip install --user opencv
pip install --user cv2
I had the same problem. Here are the steps for Windows 10 users.
Open CMD: win+r
then type cmd
. Now,
pip install virtualenv
virtualenv testopencv
cd testopencv
.\Scripts\activate
pip install opencv-contrib-python --upgrade
Python
then import cv2
hit enter then type print(cv2.__version__)
to check if its installedNow, open a new cmd, win + r then type cmd
, repeat step 6. If it gives you an error.
Go inside the testopencv
folder, inside lib
. Copy everything, go to your python directory, inside lib
folder paste it and skip that are already present.
Again open a new cmd, repeat Step 6
.
Hope it helps.