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

add more detail on platform missmatch errors instead of just declaring not matching distributions found #5003

Open
RonnyPfannschmidt opened this issue Jan 30, 2018 · 6 comments
Labels
C: error messages Improving error messages type: enhancement Improvements to functionality UX User experience related

Comments

@RonnyPfannschmidt
Copy link
Contributor

pip 9.0.1 python 2

got

$ pip install --user keyring_jeepney
Collecting keyring_jeepney
  Could not find a version that satisfies the requirement keyring_jeepney (from versions: )
No matching distribution found for keyring_jeepney

expected

$ pip install --user keyring_jeepney
Collecting keyring_jeepney
  Could not find a version that is supported on your platform
  # perhaps some more information on the platform mismatch, like os, python version 
No matching distribution found for keyring_jeepney
@pradyunsg
Copy link
Member

Heyo!

Yeah. We should print the number of compatible distributions found by platform and all.

I think there's an existing issue for this, or its mentioned in another issue somewhere. I don't have the time to look right now. =|

@pradyunsg
Copy link
Member

Found it: #4649 (comment)

Leaving this issue open to track the number of compatible releases "not selected" being printed. :)

@cowlinator
Copy link

This error is misleading should be fixed. Please don't forget about this issue!

@lyndsysimon
Copy link

@cowlinator - it’s only a year later, but I was looking for something to contribute and will be picking this up. :)

@lyndsysimon
Copy link

Let’s make sure I understand this one. In the example above of keyring-jeepney, the package has a classifier of Programming Language :: Python :: 3, and the user is trying to install it in a cPython 2.x environment.

The desired state then would be something like this:

$ pip install --user keyring_jeepney
Collecting keyring_jeepney
  Could not find a version that is supported on your platform: `Python 2.7.17`
  Supported versions:
    - Programming Language :: Python :: 3
No matching distribution found for keyring_jeepney

If someone could review the above desired state I’d appreciate it. Once that’s confirmed I’ll figure out how to get the list of classifiers from the package and implement the change and associated tests.

@Julian
Copy link
Contributor

Julian commented Dec 22, 2019

I don't think the classifiers should be involved (though I haven't looked at the internals) -- but I'd be almost positive pip's notion of what discovered distributions are applicable is some other internal state (one using packaging probably, and coming from the filenames) -- so, I think you're on the right track, but to write out something without the classifier, here's perhaps a similar rough sketch of what I might personally hope for for one specific hypothetical case:

$ pip install --user keyring_jeepney
Collecting keyring_jeepney
  Could not find a version that is supported on your platform (CPython 3.6.3 on macOS)
  Found 2 unsuitable binary distributions:
    keyring_jeepney-0.3.2.whatever.whl ([in green]CPython3[endgreen] for [in red]Linux[endred])
    keyring_jeepney-0.4.7.whatever.whl ([in red]PyPy[endred] for [in green]macOS[endgreen])
  and no available source distribution.

Others may pipe up with improvements/suggestions, but I think something like that is at least in the ballpark.

And thanks again for trying to tackle this -- I think it'd be a big win (I can say anecdotally I probably have explained this specific error to >~20 people myself in #python).

@nlhkabu nlhkabu added C: error messages Improving error messages UX User experience related labels Jul 28, 2020
@nlhkabu nlhkabu removed this from the Print Better Error Messages milestone Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: error messages Improving error messages type: enhancement Improvements to functionality UX User experience related
Projects
None yet
Development

No branches or pull requests

6 participants