`pip download --python-version` fails when downloaded package doesn't support the Python version running pip
See original GitHub issue- Pip version: 10.0.1
- Python version: 2.7
- Operating system: Linux (Debian)
Description:
I’m using pip download
to download packages for a different version of Python than the version that pip is running on. Specifically, I’m using pip on Python 2.7 to download packages for Python 3.5. The wheel for Python 3.5 is downloaded successfully, but pip download
exits with an error since the wheel specifies a minimum Python version of 3.4.
Setting ignore_requires_python=True
in pip/_internal/commands/download.py
turns the error into a warning (which still isn’t ideal), but would the proper fix be for check_requires_python
to consider the Python version passed to the download
command?
What I’ve run:
$ pip download python-rapidjson --dest . --no-deps --platform manylinux1_x86_64 --python-version 35 --implementation cp --abi cp35m
Collecting python-rapidjson
File was already downloaded /tmp/py/python_rapidjson-0.5.2-cp35-cp35m-manylinux1_x86_64.whl
python-rapidjson requires Python '>=3.4' but the running Python is 2.7.9
With verbose output, the last part of the output is:
Downloading from URL https://files.pythonhosted.org/packages/44/59/70b5060b7a5afaec36cdb618dd1c59a389642e739a49b76fef81446f18f8/python_rapidjson-0.5.2-cp35-cp35m-manylinux1_x86_64.whl#sha256=d20ca8dfd9db296941c1f978231ddf9402494c868ae8d6e431b59c8406063cad (from https://pypi.org/simple/python-rapidjson/)
Saved ./python_rapidjson-0.5.2-cp35-cp35m-manylinux1_x86_64.whl
python-rapidjson requires Python '>=3.4' but the running Python is 2.7.9
Exception information:
Traceback (most recent call last):
File "/home/michael/apps/virtualenv/local/lib/python2.7/site-packages/pip/_internal/basecommand.py", line 228, in main
status = self.run(options, args)
File "/home/michael/apps/virtualenv/local/lib/python2.7/site-packages/pip/_internal/commands/download.py", line 221, in run
resolver.resolve(requirement_set)
File "/home/michael/apps/virtualenv/local/lib/python2.7/site-packages/pip/_internal/resolve.py", line 103, in resolve
self._resolve_one(requirement_set, req)
File "/home/michael/apps/virtualenv/local/lib/python2.7/site-packages/pip/_internal/resolve.py", line 262, in _resolve_one
check_dist_requires_python(dist)
File "/home/michael/apps/virtualenv/local/lib/python2.7/site-packages/pip/_internal/utils/packaging.py", line 55, in check_dist_requires_python
'.'.join(map(str, sys.version_info[:3])),)
UnsupportedPythonVersion: python-rapidjson requires Python '>=3.4' but the running Python is 2.7.9
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
On the old python 2.7.5 version, the pip install package does ...
I have Python 2.7.5 and pip 20.2.4 installed on my computer. When I use the pip install command it gives an SSL connection...
Read more >pip download - pip documentation v22.3.1
The Python interpreter version to use for wheel and “Requires-Python” compatibility checks. Defaults to a version derived from the running interpreter. The ...
Read more >Installing pip is not working in python < 3.6 - Stack Overflow
The last command is to upgrade to the latest supported version. For Python 2.7 the latest supported is currently pip 20.3.4. For Python...
Read more >How to Install Pip on Windows - ActiveState
Pip is the standard package manager for Python. · If you do not have a version of Python installed, you can quickly download...
Read more >Installation — pandas 1.5.2 documentation
The simplest way to install not only pandas, but Python and the most popular ... get the newest version of pandas, it's recommended...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FYI, I posted PR #6577 to address this issue.
Thanks for working on this @cjerdonek! 😃