Pycharm/Python OpenCV and CV2 install error

Sibi picture Sibi · Jun 12, 2016 · Viewed 146.5k times · Source

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

but I'm getting the following error for them:

Collecting opencv
  Could not find a version that satisfies the requirement opencv (from versions: )
No matching distribution found for opencv

and

Collecting cv2
  Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2

How can I fix these and install the packages properly? I'm using python 3.4.

Answer

Ryan Guest picture Ryan Guest · Jan 31, 2018

You are getting those errors because opencv and cv2 are not the python package names.

These are both included as part of the opencv-python package available to install from pip.

If you are using python 2 you can install with pip:

 pip install opencv-python

Or use the equivilent for python 3:

pip3 install opencv-python

After running the appropriate pip command your package should be available to use from python.