Reputation: 323
I have been using Pycharm
from a long time, I was using python 3.7
and it was working fine for me.
Lately I have shifted to Machine learning and I came to know I can't use OpenCv
in python 3.7 so i uninstalled python 3.7 and install python 3.6
Now When I tried to import libraries like PIL, cv2
It gave me an error that you are using version 9.0 of pip. Update it to install these packages.(I was able to use cv2 in python 3.7)
So I updated it using pycharm
and now it has been updated to version 18.1
(could be seen in the given picture)
Now when I try to install the packages again it still gives me this error.
I have checked my version of pip from cmd and pip is also updated here.
Python
is installed in the location "C:\Users\Riyouk\AppData\Local\Programs\Python\Python36"
I checked pip version at that location and it still gives version 18.1
Anyone who encountered same problem or have knowledge about this ?
Upvotes: 1
Views: 1141
Reputation: 6061
cv2 doesn't exist as a package on PyPi.
Use:
pip install opencv-python
As documentation says:
Unofficial pre-built OpenCV packages for Python.
For Pillow, use:
pip install Pillow
Now you can import installed packages and use them:
from PIL import Image
import cv2
Upvotes: 2