Jiji
Jiji

Reputation: 30

OpenCV not installing via pip install opencv nor pip install cv2

I tried to install OpenCV using pip install opencv, but got the following error:

ERROR: Could not find a version that satisfies the requirement opencv
ERROR: No matching distribution found for opencv
WARNING: You are using pip version 21.0.1; however, version 21.1.1 is available.
You should consider upgrading via the 'c:\users\ozark\appdata\local\programs\python\python38- 
32\python.exe -m pip install --upgrade pip' command.

Then I tried using pip install cv2, but again got an error:

ERROR: Could not find a version that satisfies the requirement cv2
ERROR: No matching distribution found for cv2
WARNING: You are using pip version 21.0.1; however, version 21.1.1 is available.
You should consider upgrading via the 'c:\users\ozark\appdata\local\programs\python\python38- 
32\python.exe -m pip install --upgrade pip' command.

What am I doing wrong? I read the docs, and it clearly said to use cv2? Any help is appreciated. Thank you in advance.

Upvotes: 1

Views: 4840

Answers (1)

user15835249
user15835249

Reputation:

Well, you actually have to use pip install opencv-python to install OpenCV via pip. You have to use "cv2" when importing the module.

Example:

import cv2

And:

pip install opencv-python

I hope this helps, and happy coding!

Upvotes: 10

Related Questions