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

More helpful error when no matching version #6919

Closed
jtrakk opened this issue Aug 25, 2019 · 3 comments
Closed

More helpful error when no matching version #6919

jtrakk opened this issue Aug 25, 2019 · 3 comments
Labels
auto-locked Outdated issues that have been locked by automation C: dependency resolution About choosing which dependencies to install resolution: duplicate Duplicate of an existing issue/PR type: enhancement Improvements to functionality

Comments

@jtrakk
Copy link

jtrakk commented Aug 25, 2019

Sometimes I try to install something and it says

Could not find a version that satisfies the requirement foobar (from versions: none)

when there is a package by that name but some constraint isn't satisfied, such as python_requires or --no-binary. This situation can be confusing.

The error message could explain what happened:

Found a package named foobar, but it specifies requirements that were not satisfied:
- python_requires: 3.7
- platform: Darwin
@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Aug 25, 2019
@chrahunt chrahunt added C: dependency resolution About choosing which dependencies to install state: needs discussion This needs some more discussion type: enhancement Improvements to functionality labels Aug 25, 2019
@triage-new-issues triage-new-issues bot removed S: needs triage Issues/PRs that need to be triaged labels Aug 25, 2019
@chrahunt
Copy link
Member

I can see this being useful for complex packages that publish many different versions. Here are a few options:

  1. Put the information in an error message, as shown above. One potential problem is that the actual error might get lost if displaying information for several packages (see e.g. tensorflow)
  2. A separate pip command that we could reference in the error text which, when run, would provide output similar to the above
  3. A separate utility outside of pip - at the very least we could point to the parts of pip that would be helpful examples for implementing something like this.

Since we're planning to swap out the dependency resolver in pip at some point, I think it's worthwhile to ask whether this kind of checking is a use case that's been considered.

@pradyunsg, any thoughts?

@pradyunsg
Copy link
Member

This specific case is probably covered in #5003. I'll go ahead and close this issue as a duplicate of that issue. ;)


A separate pip command that we could reference in the error text which, when run, would provide output similar to the above

I touched upon this in #6119. I like the idea -- we just need to create the software infrastructure around our logging to make it much easier to do. Or someone needs to figure out a better way than I outlined there, which I'm sure exists, given our trade-offs of developer time.


Error reporting for dependency resolvers, is a lot more complicated than it seems on it's surface. For context, this is the best current work that I could find, and that's not as informative as I'd hoped. And that's in a model that's simpler than Python packaging's dependency model. :(

I've sunken a lots of hours thinking and scribbling about this. I have some ideas; however, lack of time and mental peace needed to tackle a purely theoretical problem like this isn't helping. :)

@pradyunsg
Copy link
Member

Also, thanks for filing this @jtrakk! Much appreciated! ^>^

@pradyunsg pradyunsg added resolution: duplicate Duplicate of an existing issue/PR and removed state: needs discussion This needs some more discussion labels Aug 25, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Sep 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: dependency resolution About choosing which dependencies to install resolution: duplicate Duplicate of an existing issue/PR type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

3 participants