I am struggling with Jetson TX2 board (aarch64).
I need to install python wrapper for OpenCV.
I can do:
$ sudo apt-get install python-opencv
But I cannot do:
$ sudo pip install opencv-python
Is this because there is no proper wheel file in http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv?
Is there a way to install opencv-python through pip?
asked Jul 25, 2017 at 4:27
6
We were getting the same error.For us, it solved by upgrading pip version (also discussed in FAQ of OpenCV GitHub). Earlier we had pip-7.1.0, post upgrading it to «pip-9.0.2», it successfully installed.
pip install --upgrade pip
pip install opencv-python
double-beep
4,85916 gold badges32 silver badges41 bronze badges
answered Mar 19, 2018 at 7:33
NeoNeo
4,9429 gold badges45 silver badges64 bronze badges
3
pip
doesn’t use http://www.lfd.uci.edu/~gohlke/pythonlibs/, it downloads packages from PyPI.
The problem is that you have an unusual architecture; pip
cannot find a package for it and there is no source code package.
Unfortunately I think you’re on your own. You have to download source code from https://github.com/skvark/opencv-python, install compiler and necessary libraries and compile OpenCV yourself.
answered Jul 25, 2017 at 11:51
phdphd
77.7k12 gold badges112 silver badges152 bronze badges
Use this and it will work:
pip install --upgrade pip
pip install opencv-python
Paul Roub
36.2k27 gold badges82 silver badges90 bronze badges
answered Nov 28, 2018 at 17:47
1
Another problem can be that the python version you are using is not yet supported by opencv-python.
E.g. as of right now there is no opencv-python for python 3.8. You would need to downgrade your python to 3.7.5 for now.
answered Nov 3, 2019 at 14:05
JodoJodo
4,3155 gold badges36 silver badges50 bronze badges
2
It happened with me on Windows, pip was not able to install opencv-python==3.4.0.12
.
Later found out that it was due to the Python version, Python 3.7 has some issue with not getting linked to https://github.com/skvark/opencv-python.
Downgraded to Python 3.6 and it worked with:
pip3 install opencv-python
double-beep
4,85916 gold badges32 silver badges41 bronze badges
answered Jul 12, 2018 at 8:27
Manish SManish S
78110 silver badges12 bronze badges
0
I faced the same issue but the mistake which I was making was pip install python-opencv
where I should have used pip install opencv-python
. Hope this helps to anyone. It took me few hours to find.
answered Feb 10, 2021 at 14:59
As there is no proper wheel file in http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv?
Try this:(Worked in Anaconda Prompt or Pycharm)
pip install opencv-contrib-python
pip install opencv-python
Nick
134k22 gold badges53 silver badges90 bronze badges
answered Nov 10, 2019 at 2:53
1
A way to do this is to install Anaconda on your computer.
Then you should be able to do:
pip install opencv-python
or
conda install opencv
answered Jul 17, 2019 at 19:34
Akaisteph7Akaisteph7
4,6562 gold badges17 silver badges39 bronze badges
1
I had the same error. The first time I used the 32-bit version of python but my computer is 64-bit. I then reinstalled the 64-bit version and succeeded.
stateMachine
4,8364 gold badges12 silver badges27 bronze badges
answered Mar 30, 2020 at 14:44
Install it by using this command:
pip install opencv-contrib-python
fcdt
2,3315 gold badges12 silver badges26 bronze badges
answered Oct 7, 2020 at 7:33
I faced same issue while using Python 3.9.0.
Upgrading python to latest version (currently 3.9.1) and reinstalling opencv-python solved this issue.
answered Jan 26, 2021 at 11:25
I got this error and I solved it by simply waiting.
I had similar problem:
ERROR: Could not find a version that satisfies the requirement opencv-contrib-python (from versions: none)
Command pip update
was not resolving my issue.
After lunch-time I tried again and it installed correctly the package.
Maybe the server was down.
answered Jun 8, 2021 at 12:35
Sometimes you get an error when you’re trying to install a Python package
using pip. It looks like this:
Could not find a version that satisfies the requirement (from versions:)
No matching distribution found for
Some probable reasons for this error are:
-
PyPI server isn’t responding to your requests. It can happen either because
the PyPI server is down or because it has blacklisted your IP address. This
happened to me once when I was trying installing packages on a server.
This can be fixed by using a proxy with pip. See the solution below. -
You’re running an older pip (especially on Mac). This can be fixed by
upgrading your pip.
See this post on Stack Overflow.
Thanks to Anupam Jain who pointed this in a comment. -
The package you’re trying to install is not available for your Python version.
-
The package is not available for your operating system. This is a rare case
and only happens when the package is not pure-Python, i.e. it’s been
partially written in C or Cython. Such a package needs to be compiled for
every operating system (Windows/Mac/Linux) and architecture (32-bit/64-bit).
Suppose a package has only been compiled for Windows 64-bit, then you’ll get
this error if you try to install it on Windows 32-bit, or any other
OS. -
The package is not present on PyPI server. In this case pip will not work. So
you’ll have to download and install the package manually from Github or wherever
it is available.
Solution¶
I had this issue because PyPI server had blacklisted the IP
of my hosting provider, the obvious solution was to make pip
install via a proxy.
But to see if that’s also the case with you, you can test it like this:
$ curl https://pypi.org
The requestors Network has been blacklisted due to excessive request volume.
If you are a hosting customer, please contact your hosting company's support.
If you are the hosting company, please contact infrastructure-staff@python.org to resolve
If you see the message similar to above, that means your IP has also been
blacklisted by https://pypi.org.
If you don’t see this message then the reason for the pip error could be that you’re using
an older version. See this post on Stack Overflow
for a solution.
Anyways, this can be fixed by using a proxy with pip.
Supplying a proxy address to pip
is easy:
$ pip install -r requirements.txt --proxy address:port
Above, address
and port
are IP address and port of the proxy.
To find proxies, just search Google for proxy list.
Other things that I tried¶
These are some other things that I tried to get rid of this issue.
Although they didn’t work for me, but they might work for you.
- Changing DNS resolver of my server.
This makes sense if your server’s DNS resolver can’t find PyPI servers. - Reconfiguring SSL, reinstalling CA certificates.
This makes sense if you don’t have updated CA certificates which are used by
PyPI servers. - Downloading packages using
wget
.
This is an alternative way to install Python packages. Download them viawget
and then install them usingpython setup.py install
. In my case, the server was
blacklisted by PyPI so I was getting a 403 Forbidden error. - Downloading packages using
curl
.
Alternative towget
. In my case I didn’t get a 403 error but rather it just
created invalid tarball files, instead of actually downloading them. - Downloading packages using
git
orhg
.
If your desired packages havegit
orhg
repositories that you can clone, this
is a good workaround.
-
gordon77
- Posts: 7064
- Joined: Sun Aug 05, 2012 3:12 pm
sudo pip3 install opencv-python fails…
using latest Raspbian…
Code: Select all
sudo pip3 install opencv-python
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting opencv-python
Could not find a version that satisfies the requirement opencv-python (from versions: )
No matching distribution found for opencv-python
Anyone know /explain why ?
-
gordon77
- Posts: 7064
- Joined: Sun Aug 05, 2012 3:12 pm
Re: sudo pip3 install opencv-python fails…
Wed Jun 26, 2019 7:03 am
Thanks, modified my install..
Code: Select all
sudo apt-get install python3-opencv
sudo apt-get install libhdf5-dev
sudo apt-get install libhdf5-serial-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libjasper-dev
sudo apt-get install libqtgui4
sudo apt-get install libqt4-test
opencv now works, but gives a few anomalies on the image, lines, which I need to investigate.
but works OK when using pygame to display, opencv to capture (screen.jpg)
- Attachments
-
- screen.jpg (33.92 KiB) Viewed 6585 times
-
- Untitled.jpg (64.36 KiB) Viewed 6591 times
-
ggNoOpenCV
- Posts: 1
- Joined: Wed Jun 26, 2019 12:46 pm
Re: sudo pip3 install opencv-python fails…
Wed Jun 26, 2019 12:49 pm
This command is only for version 3.2.0, is there no way to get a higher version on buster currently? Is there any stable os that supports new versions of opencv?
-
gordon77
- Posts: 7064
- Joined: Sun Aug 05, 2012 3:12 pm
Re: sudo pip3 install opencv-python fails…
Wed Jun 26, 2019 5:10 pm
ggNoOpenCV wrote: ↑
Wed Jun 26, 2019 12:49 pm
This command is only for version 3.2.0, is there no way to get a higher version on buster currently? Is there any stable os that supports new versions of opencv?
Jessie and pip3 install opencv-python used to install v 3.4.4
-
tkasidakis
- Posts: 2
- Joined: Tue Jun 30, 2020 10:40 am
Re: sudo pip3 install opencv-python fails…
Wed Jul 22, 2020 12:34 pm
Hello.
How i can install opencv 3.3 or anothere newer version ?
I have a raspberry pie 4 B 64 bit and ubuntu 18.04 as an OS .
When i am doing pip3 install opencv-contrib-python==3.4.6.27
i am taking this error
Code: Select all
ERROR: Could not find a version that satisfies the requirement opencv-contrib-python==3.4.6.27 (from versions: none)
ERROR: No matching distribution found for opencv-contrib-python==3.4.6.27
Finally i install opencv from github etc.
Is there a way doing this with pip3 ? I am seraching for a version > 3.3 . Is there something for arm architecture at Pypi ?
Thanks in advance for the help
-
decades
- Posts: 6
- Joined: Wed Jan 17, 2018 7:30 pm
Re: sudo pip3 install opencv-python fails…
Tue Nov 17, 2020 1:35 pm
You could try another version, like pip3 install opencv-python==3.4.10.37
But for me this also didn’t work. It failed while it was building
Return to “Python”