Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain why version cannot be retrieved due to python-requires #9615

Closed
Colin-b opened this issue Feb 16, 2021 · 3 comments · Fixed by #9708
Closed

Explain why version cannot be retrieved due to python-requires #9615

Colin-b opened this issue Feb 16, 2021 · 3 comments · Fixed by #9708
Labels
C: error messages Improving error messages state: awaiting PR Feature discussed, PR is needed type: feature request Request for a new feature

Comments

@Colin-b
Copy link

Colin-b commented Feb 16, 2021

What's the problem this feature will solve?

I am trying to install a specific version of a package (ipython==7.20.0 in this case). However my version of python is 3.6 and the python-requires of this version is 3.7 at the latest. Leading to pip displaying this upon install request:

ERROR: Could not find a version that satisfies the requirement ipython==7.20.0
ERROR: No matching distribution found for ipython==7.20.0

Describe the solution you'd like

I would like for pip to display that even if this version exists, it cannot be installed as it is incompatible with my python version.

A message like the following would be neat:

ERROR: Could not find a version that satisfies the requirement ipython==7.20.0
ERROR: ipython==7.20.0 was found, however it cannot be installed as your python version (3.6.X) is incompatible with the requirements of this distribution (>=3.7).

Now that more and more python modules are dropping support for python 3.6 (pandas, numpy, werkzeug from the top of my head) while python 3.6 is still heavily used, I am fairly certain the number of users facing this rejection is high.

The message is not clear enough to understand in one go what the issue was and forces the developer in question to investigate. While pip already did the investigation, but did not shared the reason.

It's maybe a long shot but it would be even better if the message could provide the latest compatible version for such project (if any).

Thanks for your time

@uranusjr
Copy link
Member

Sounds reasonable, but the implementation would be much less straightforward than it would seem at first glance. Python package distribution is file-based, not version-based, so it does not actually make sense to say “ipython==7.20.0 was found but cannot be installed due to Requires-Python” because different files for the specified version may have different specifiers. The logic to come up with a comprehensive message may not be too difficult, but will be tedious and require time. I would welcome anyone interested to try their hands on this; it’d be a fun excersise to walk you through some interesting aspects of Python packaging.

@uranusjr uranusjr added state: awaiting PR Feature discussed, PR is needed type: feature request Request for a new feature C: error messages Improving error messages labels Feb 17, 2021
@ronaudinho
Copy link
Contributor

image
I guess something like this would do?

@Colin-b
Copy link
Author

Colin-b commented Mar 13, 2021

image
I guess something like this would do?

Yes it would!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: error messages Improving error messages state: awaiting PR Feature discussed, PR is needed type: feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants