Could not find a version that satisfies the requirement package
This approach (having all dependencies in a directory and not downloading from an index) only works when the directory contains all packages. The directory should therefore contain all dependencies but also all packages that those dependencies depend on (e.g., six
, pytz
etc).
You should therefore manually include these in requirements.txt
(so that the first step downloads them explicitly) or you should install all packages using PyPI and then pip freeze > requirements.txt
to store the list of all packages needed.
Pip could not find a version that satisfies the requirement
From PyPI, jurigged
is only supported as of Python >= 3.8 (see also here)
pip
doesn't find anything to install because you do not meet the requirements.
Upgrade to Python >= 3.8 and do the same: pip install jurigged
pip install' fails for every package (Could not find a version that satisfies the requirement)
Upgrade pip as follows:
curl https://bootstrap.pypa.io/get-pip.py | python
Note: You may need to use sudo python
above if not in a virtual environment.
What's happening:
Python.org sites are stopping support for TLS versions 1.0 and 1.1. This means that Mac OS X version 10.12 (Sierra) or older will not be able to use pip unless they upgrade pip as above.
(Note that upgrading pip via pip install --upgrade pip
will also not upgrade it correctly. It is a chicken-and-egg issue)
This thread explains it (thanks to this Twitter post):
Mac users who use pip and PyPI:
If you are running macOS/OS X version 10.12 or older, then you ought
to upgrade to the latest pip (9.0.3) to connect to the Python Package
Index securely:curl https://bootstrap.pypa.io/get-pip.py | python
and we recommend you do that by April 8th.
Pip 9.0.3 supports TLSv1.2 when running under system Python on macOS <
10.13. Official release notes: https://pip.pypa.io/en/stable/news/
Also, the Python status page:
Completed - The rolling brownouts are finished, and TLSv1.0 and TLSv1.1 have been disabled. Apr 11, 15:37 UTC
Update - The rolling brownouts have been upgraded to a blackout, TLSv1.0 and TLSv1.1 will be rejected with a HTTP 403 at all times.
Apr 8, 15:49 UTC
Lastly, to avoid other install errors, make sure you also upgrade setuptools after doing the above:
pip install --upgrade setuptools
ERROR: No matching distribution found and ERROR: Could not find a version that satisfies the requirement
The chosen package called Deep-Object-Removal seems to be very outdated (last commit 4years ago) and not maintained any longer, i would suggest to search for any currently supported alternative.
If you try to install this version of opencv_python
in a clean python venv (with python3.10
) you get an error:
pip install opencv_python==3.3.0.10
ERROR: Could not find a version that satisfies the requirement opencv_python==3.3.0.10 (from versions: 3.4.0.14, 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.15.55, 3.4.16.57, 3.4.16.59, 3.4.17.61, 3.4.17.63, 3.4.18.65, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.3.56, 4.5.4.58, 4.5.4.60, 4.5.5.62, 4.5.5.64, 4.6.0.66)
ERROR: No matching distribution found for opencv_python==3.3.0.10
If you have a look at the files at pypi for this version of opencv_python
you notice that this version of the pkg. has been yanked.
Additional there is no pkg. for python3.10
, the last support whl file seems to be for python3.6
.
You can try to adapt the requirements.txt
with a newer one of opencv_python
or install python3.6
and download the specific version by hand and install the whl
file,( but this may lead to new errors).
But again i would recommend to use another, currently supported package instead of Deep-Object-Removal.
pip: Could not find a version that satisfies the requirement in WSL
The list of packages suggests you're using Python 2.7. You could have Python 3.6 but your pip
runs under Python 2.7. Check with pip --version
.
Try pip3 install Django
or python3.6 -m pip install Django
.
Could not find a version that satisfies the requirement evaluate
Look at the left side-bar on PyPi package page for evaluate
. Near the bottom is the "Programming Language" section. It lists availability for Python version 3.7 to 3.10.
You will need to create a new environment with one of those versions of Python.
Getting the following error: Could not find a version that satisfies the requirement command-not-found==0.3
command-not-found
doesn't seem to exist on PyPI, but it is a package in Ubuntu and Debian repositories. It doesn't look like anything that your application should depend on, and it certainly doesn't belong on Heroku.
I suspect
- you're trying to create your dependencies file after the fact, by simply doing
pip freeze > requirements.txt
, and - that you're either not working in a virtual environment or you created your virtual environment with system packages.
This is an antipattern that will cause several packages that your application doesn't actually need to be included in your requirements.txt
. In this case it is even including Python packages that come from system packages and aren't meant to be installed from PyPI. Your requirements.txt
should contain only your actual dependencies.
Instead of creating it with pip freeze
after the fact, add things to that file before, and install them into your virtual environment with the same pip install -r requirements.txt
command that you'll use in production. I also very strongly urge you to use a virtual environment.
In this case, I suggest you edit your requirements.txt
and remove anything you don't actually need, commit, and redeploy.
Python Pip: pip install cannot find a version that satisfies a requirement - despite present in pyproject.toml
Main Error
TLDR; Pip tries to resolve dependencies with TestPypi, but they are in another index (Pypi). Workarounds at end of answer.
The fact that I am publishing to TestPypi is the reason this has happened. I will explain why what I did made this error appear, and then I will show how you, from the future, may solve this.
Difference between Pypi and TestPypi
Pypi is the Python Package Index. It's a giant index of Python packages one may install from with pip install
.
TestPypi is the Python Package Index designated for testing and publishing without touching the real Package Index. It can be useful in times when learning how to publish a package. The main difference is that it is a completely separate repository. Therefore, what's on TestPypi may not be exactly what's on Pypi.
My research was limited, so if I confused anyone, the main difference is that they are two different Package Indexes. One was made for testing purposes.
I published my package to TestPypi and set my pip install to install from that repository. Not Pypi, but TestPypi.
Why dependency resolution failed
When I defined my project's dependencies, I defined them based off of their Pypi presences. Most dependencies are present in Pypi. Not TestPypi. This meant that when I asked for my package from TestPypi, pip only looked at TestPypi, and the pip installer workflow fell out to a pattern like this:
0.5. Set fetching repository to TestPypi and Not Pypi.
- Pull package from TestPypi
- Install and examine dependencies
- Find first dependency (e.g. Beautifulsoup4)
- Pull dependency from TestPypi
- Successfully install Beautifulsoup4
-. This is because beautifulsoup4 is actually present in the TestPypi. - Move on to another dependency (e.g. rich)
- Fail to pull from TestPypi
-. Rich is not present in TestPypi. - Return dependency not found.
Why some dependencies oddly worked
As you see in workflow step 5., the beautifulsoup4 package was found on the TestPypi. (Someone had put it up there).
image to TestPypi page with beautifulsoup4
However, as you see in step 7., Rich is not found on the TestPypi index. This issue occurs because I set my repoistiroy to install from TestPypi because my that is where my package was held. This caused pip to use TestPypi. for every single dependency as well.
How I got around it.
I got around it by using TestPypi to verify accurate build artifact publishing, and then I jumped to Normal Pypi to test installation and dependency installation.
Workarounds
Install from TestPypi
python3 -m pip install -i https://test.pypi.org/simple/ <package name>
Install from Pypi (by default)
python3 -m pip install <package name>
Install package from TestPypi but dependencies from Pypi
The Python Docs explains this very well.
If you want to allow pip to also download packages from PyPI, you can specify --extra-index-url to point to PyPI. This is useful when the package you’re testing has dependencies:
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ your-package
Related Topics
Pygame: Problems with Shooting in Space Invaders
How to Read a Column of CSV as Dtype List Using Pandas
Remove All Line Breaks from a Long String of Text
How to Check If One Dictionary Is a Subset of Another Larger Dictionary
How to Use Python Numpy.Savetxt to Write Strings and Float Number to an Ascii File
Python Parsing Bracketed Blocks
Django Rest Framework Post Nested Objects
How to Run Python Script on Terminal
How to Convert an Iterable to a Stream
How to Add a Timeout to a Function in Python
How to Use MySQLdb with Python and Django in Osx 10.6
Format Strings VS Concatenation
How to Copy Inmemoryuploadedfile Object to Disk
Remove Non-Ascii Characters from Pandas Column
Open Cv Error: (-215) Scn == 3 || Scn == 4 in Function Cvtcolor