I am using Python 3.8.7 and the latest version of Pip, v21.0.1. I have written a package that contains the following Python version constraint:
python_requires='>=3.6, <3.9',
When I try to install the package, Pip refuses and prints the following error:
ERROR: Package 'my-package' requires a different Python: 3.8.7 not in '<3.9,>=3.6'
I have seen a similar error when installing other packages with similar version constraints:
ERROR: Package 'my-other-package' requires a different Python: 3.8.7 not in '!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,<3.9,>=2.7'
Clearly Python 3.8.7 is greater than 3.6 and less than 3.9, so why does Pip claim that a different version of Python is required?
Some investigation suggests that this may be an inaccurate error message. I have run an experiment uses packages with the following dependent relationship:
I have found that when installing package-a using Python 3.9, I receive the following error:
ERROR: Package 'package-a' requires a different Python: 3.9.0 not in '>=3.6'
So basically, package-a cannot be installed with Python 3.9 because package-b does not work with Python 3.9; however, Pip erroneously states that package-a requires a "different" Python, and then erroneously prints out package-a's version specifier, rather than package-b.
I will continue to investigate, but this may be a bug in Pip itself.
PIP is automatically installed with Python 2.7.9+ and Python 3.4+ and it comes with the virtualenv and pyvenv virtual environments. Before you install PIP on Windows, check if PIP is already installed.
To Solve Could not find a version that satisfies the requirement Error You just need to update pip and your error will be resolve.
How do I Install a Specific Version of a Python Package? To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1. 3 .
Using Requirements Files. The pip install command always installs the latest published version of a package, but sometimes your code requires a specific package version to work correctly.
This was a bug in pip
and has been fixed in version 21.1 (see #9541). Specifically, it included the wrong Python constraint (the one of a dependency) in the error message when resolution failed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With