1

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.

1 Answer 1

10

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!

Sign up to request clarification or add additional context in comments.

3 Comments

This actually worked! Thanks so much, when I looked back in the documentation, this was actually what it said, and cv2 is used when importing the module. Thanks again.
No problem, I'm happy to help. Please accept the answer if it is useful.
Yes, I'm accepting, thank you so much for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.