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.
asked Jun 12, 2016 at 15:54
1
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.
answered Jan 31, 2018 at 1:40
Ryan GuestRyan Guest
5,9102 gold badges32 silver badges39 bronze badges
3
This the correct command that you need to install opencv
pip install opencv-python
if you get any error when you are trying to install the «opencv-python» package in pycharm, make sure that you have added your python path to ‘System Variables‘ section of Environment variables in Windows.
And also check whether you have configured a valid interpreter for your project
answered Apr 5, 2020 at 6:37
I ran into the same problem. One issue might be OpenCV is created for Python 2.7, not 3 (not all python 2.7 libraries will work in python 3 or greater). I also don’t believe you can download OpenCV directly through PyCharm’s package installer. I have found luck following the instructions: OpenCV Python. Specifically:
- Downloading and installing OpenCV from SourceForge
- Copying the cv2.pyd file from the download (opencvbuildpython2.7×64) into Python’s site-packages folder (something like: C:Python27Libsite-packages)
- In PyCharm, open the python Console (Tools>Python Console) and type:
import cv2
, and assuming no errorsprint cv2.__version__
Alternatively, I have had luck using this package opencv-python, which you can straightforwardly install using pip with pip install opencv-python
Good luck!
answered Sep 3, 2016 at 15:31
mdoc-2011mdoc-2011
2,5874 gold badges20 silver badges42 bronze badges
python3.6 -m pip install opencv-python
will install cv2 in python3.6 branch
answered Jun 13, 2018 at 9:47
vishalvishal
7857 silver badges16 bronze badges
0
On Windows:
!pip install opencv-python
Neuron
4,8435 gold badges36 silver badges54 bronze badges
answered Jun 16, 2020 at 4:24
1
Try this. I am using Jupyter notebook (OS: Ubuntu 16.04 LTS on Google Cloud Platform + on Windows). Executed following command in the Jupyter notebook to install opencv:
!pip install opencv-contrib-python #working on both Windows and Ubuntu
After successful installation you will get following message:
Successfully installed opencv-contrib-python-4.1.0.25
Now restart the kernel and try to import opencv as:
import cv2
The same command can be used to installed opencv on Windows as well.
SOLUTION 2: try following commands to install opencv:
For Ubuntu:
Run following command from terminal:
sudo apt-get install libsm6 libxrender1 libfontconfig1
Restart Jupyter notebook kernel and execute following command:
!pip install opencv-contrib-python
NOTE: You can run all the above commands from the terminal as well without using ‘!’.
answered Jul 26, 2019 at 3:50
Keep it simple and just run.
pip install opencv-python
This is the simplest way of installing opencv.
If you still face issue, create a virtual environment and try installing opencv.
Neuron
4,8435 gold badges36 silver badges54 bronze badges
answered Sep 15, 2021 at 15:23
2
here is a tutorial that worked for me without any problem.
Copied from the site above the important part:
Download the OpenCV version corresponding to your Python installation
from here. In my case, I’ve used
opencv_python-3.1.0-cp35-cp35m-win32.whl.Now, open a cmd window like before. You can open this directly in your
Downloads folder if you SHIFT and right click inside it. The idea is
to open a cmd window where you’ve downloaded the above […] file. Use
the […] command to install […] OpenCV:1 pip install "opencv_python-3.1.0-cp35-cp35m-win32.whl"
Additional note: don’t forget to change the name of the downloaded file in the command you use.
Apparently by installing opencv, you’ll have access to cv2 too.
answered Dec 20, 2016 at 12:08
JuditJudit
392 bronze badges
Installing opencv is not that direct.
You need to pre-install some packages first.
I would not recommend the unofficial package opencv-python. Does not work properly in macos and ubuntu (see this post). No idea about windows.
There are many webs explaining how to install opencv and all required packages.
For example this one.
The problem of trying to install opencv several times is that you need to uninstall completely before attempting again, or you might end having many errors.
answered Apr 11, 2017 at 14:46
daniel_hckdaniel_hck
1,0602 gold badges19 silver badges38 bronze badges
you must install opencv-python
pip/pip3 install opencv-python
if you try import opencv-python
, receive error.
Fix this error, use the import cv2
answered May 12, 2019 at 11:12
How about try some different mirrors?
If you are in China, I highly recommend you try:
sudo pip install --index https://pypi.mirrors.ustc.edu.cn/simple/ opencv-contrib-python
If not, just replace the url address to some other mirrors you like!
Good luck.
answered Jul 24, 2019 at 6:04
First step:
pip uninstall numpy
pip uninstall opencv-python
Second step:
pip install numpy
pip install opencv-python
answered Feb 7, 2021 at 7:25
Furkan GulsenFurkan Gulsen
1,2442 gold badges10 silver badges22 bronze badges
I had the same problem. Here are the steps for Windows 10 users.
Open CMD: win+r
then type cmd
. Now,
- Type
pip install virtualenv
- Create a Virtual Environment, Type
virtualenv testopencv
- Get Inside testopencv, Type
cd testopencv
- Activate the Virtual Environment, Type
.Scriptsactivate
- Now Install Opencv, Type
pip install opencv-contrib-python --upgrade
- Let’s test Opencv, Type
Python
thenimport cv2
hit enter then typeprint(cv2.__version__)
to check if its installed
Now, 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.
answered Jan 7, 2020 at 7:37
Debu ShinobiDebu Shinobi
1,78816 silver badges20 bronze badges
In jetso nano this work for me.
$ git clone https://github.com/JetsonHacksNano/buildOpenCV
$ cd buildOpenCV
4b0
21.4k30 gold badges95 silver badges139 bronze badges
answered Mar 30, 2020 at 11:42
When I was facing this issue I used to install OpenCV in pycharm installed package panel where we can find under the settings tab. Search «OpenCV-python» and install it in the installed package panel of right interpreter.
answered May 8, 2020 at 15:18
Hashan MalawanaHashan Malawana
3431 gold badge2 silver badges10 bronze badges
First run from cmd
pip --version
to make sure that you have the updated version installed.
Then run
pip install opencv-python
answered Jun 29, 2021 at 5:13
Go through with this link: https://learnopencv.com/install-opencv-4-on-raspberry-pi/
you can install OpenCV perfectly with out any error. but the problem was it will take lot of time to install.
I had used pi3 model B+ with 32GB class10 SD card for me it took more than 12 hours for complete installation.
answered Jul 25, 2021 at 7:01
If you still find any error to install open-cv in your mac, try this:
opencv-python==4.2.0.34
This worked for me.
answered May 2, 2022 at 22:28
Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to install cv2 with this command pip install –user cv2 but I am facing following error Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 in Python. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
Contents
- How Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error Occurs ?
- How To Solve Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error ?
- Solution 1: install opencv-python
- Solution 2: Use correct python command
- Summary
I am trying to install cv2 with this command pip install –user cv2 but I am facing following error.
Collecting cv2
Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2
How To Solve Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error ?
- How To Solve Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error ?
To Solve Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error You are facing this error because of you are
opencv
andcv2
are not the python package names Actually Both packages included as part of theopencv-python
package available to install from pip Just install opencv-python with this command. For Python 2: pip install opencv-python and For Python 3: pip3 install opencv-python Now your error must be solved and now you can use opencv and cv2. - Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2
To Solve Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error You are facing this error because of you are
opencv
andcv2
are not the python package names Actually Both packages included as part of theopencv-python
package available to install from pip Just install opencv-python with this command. For Python 2: pip install opencv-python and For Python 3: pip3 install opencv-python Now your error must be solved and now you can use opencv and cv2.
Solution 1: install opencv-python
You are facing this error because of you are opencv
and cv2
are not the python package names Actually Both packages included as part of the opencv-python
package available to install from pip Just install opencv-python with this command.
For Python 2
pip install opencv-python
For Python 3
pip3 install opencv-python
Now your error must be solved and now you can use opencv and cv2.
Solution 2: Use correct python command
You are using wrong python command. Just use this command.
pip install opencv-python
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
- SyntaxError: invalid syntax to repo init in the AOSP code.
Today We are Going To Solve Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 in Python. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.
Contents
- 1 How to Fix Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error?
- 1.1 Solution 1 : Install opencv
- 1.2 Solution 2 : Use the below command
- 2 Conclusion
- 2.1 Also Read These Solutions
- How to Fix Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error?
To Fix Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error just Install opencv. Here you have to install opencv If you are using python 2 then you can install it with pip:
pip install opencv-python
And if you are using python 3 then use the equivalentpip3 install opencv-python
- Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2
To Fix Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2 Error just Use the below command. Use this command to solve this error
pip install numpy pip install opencv-python
Solution 1 : Install opencv
Here you have to install opencv
If you are using python 2 then you can install it with pip:
pip install opencv-python
And if you are using python 3 then use the equivalent
pip3 install opencv-python
Solution 2 : Use the below command
Use this command to solve this error
pip install numpy
pip install opencv-python
Conclusion
So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.
Also Read These Solutions
- An unhandled exception occurred: NOT SUPPORTED: keyword “id”, use “$id” for schema ID
- Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)
- Notice: Trying to access array offset on value of type bool
- xlrd.biffh.XLRDError: Excel xlsx file; not supported in python
- ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
If you are getting trouble with the “Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2” error, do not worry. Today, our article will give a few solutions and detailed explanations to handle the problem. Keep on reading to get your answer.
First, you should be clear that OpenCV (Open Source Computer Vision Library) is an open-source machine learning software library, mainly computer vision. Cv2 is the module import name which represents the ‘opencv-python’ package.
This error occurs because you have some misunderstandings when installing the package. You must have installed the ‘opencv-python’ package instead of installing cv2. This is an example about the error:
pip install cv2
Result:
ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)
ERROR: No matching distribution found for cv2
Keep going on. Now, we provide you with a few ways to install ‘opencv-python’ package.
Solutions to solve this problem
Install OpenCV by using pip
Pip is a package manager used to control other packages in python.
First, make sure that your system has installed pip. If not, please visit here. In this tutorial, we only focus on installing the ‘opencv-python’ package.
Install the package by pip in Windows Operating System or Terminal with Linux Operating System or macOS, run the following command:
For the main module package:
pip install opencv-python
For full package:
pip install opencv-contrib-python
Install the package for server or no GUI library system:
For the main module package:
pip install opencv-python-headless
For full package:
pip install opencv-contrib-python-headless
Install OpenCV from GitHub
In Windows Operating System
Follow these steps
- Step 1: Download the latest.
- Step 2: Unzip to C:opencv.
- Step 3: Add the Path in Environment Variables setting to C:opencvbin.
- Step 4: Reset your computer
- Step 5: Run the command
echo %Path%
in your Command Prompt. If there is the Path to C:opencvbin, you installed it successfully.
In Linux Operating System
Step 1: Install essential packages
sudo apt update && sudo apt install -y cmake g++ wget unzip
Step 2: Download and unzip sources
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip
unzip opencv.zip
Step 3: Create a directory to build the sources
mkdir -p build && cd build
Step 4: Make configuration
cmake ../opencv-4.x
Step 5: Build modules
cmake --build
Source: opencv.org
Summary
Our article has explained the cause of the “Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2” error. We also give you instructions to install OpenCV as a user and developer. Hope you our tutorial helps you to fix the problem completely. Thanks for reading!
Maybe you are interested:
- IsADirectoryError: [Errno 21] Is a directory in Python
- ‘pyinstaller’ is not recognized as an internal or external command operable program or batch file
My name is Robert Collier. I graduated in IT at HUST university. My interest is learning programming languages; my strengths are Python, C, C++, and Machine Learning/Deep Learning/NLP. I will share all the knowledge I have through my articles. Hope you like them.
Name of the university: HUST
Major: IT
Programming Languages: Python, C, C++, Machine Learning/Deep Learning/NLP
pip install cv2 install error:
ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)
ERROR: No matching distribution found for cv2
Solution:
Change CV2 to opencv-python
pip install opencv-python
Rule:
pip install Plugin -i http://pypi.douban.com/simple/ –trusted-host pypi.douban.com
Codes:
pip install opencv-python -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Similar Posts:
- Error reported by PIP install third-party library [How to Solve]
- [Solved] Python import module error: importerror: no module named mysql.connector
- PIP install Error: Could not fetch URL [How to Solve]
- [Solved] Python3.7 Install urllib.parse[UNK]json[UNK]re
- Pip Install Error:There was a problem confirming ssl certificate
- Note that pyqt5 tools cannot be installed on Mac
- Python Installation WARNING: pip is configured with locations that require TLS/SSL, however the ssl module…
- Upgrade pip Error: ”’SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED]…”
- Error in installing Python package — readtimeouterror
- Consider using the `–user` option or check the permissions.