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

Unclear error message when requirements conflict #8361

Open
astrofrog opened this issue May 29, 2020 · 4 comments
Open

Unclear error message when requirements conflict #8361

astrofrog opened this issue May 29, 2020 · 4 comments
Labels
C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages state: needs eyes Needs a maintainer/triager to take a closer look

Comments

@astrofrog
Copy link

I am testing out the resolver in pip 20.2b and found that while it is able to identify conflicts/incompatible versions, the error message even for simple cases is not very clear - as an example:

% pip install "numpy<1.16" "astropy>4.0"
Collecting astropy>4.0
  Downloading astropy-4.0.1.post1-cp38-cp38-macosx_10_9_x86_64.whl (6.5 MB)
     |████████████████████████████████| 6.5 MB 13.5 MB/s 
Collecting astropy>4.0
  Downloading astropy-4.0.1-cp38-cp38-macosx_10_9_x86_64.whl (6.5 MB)
     |████████████████████████████████| 6.5 MB 2.8 MB/s 
ERROR: Could not find a version that satisfies the requirement numpy<1.16
ERROR: Could not find a version that satisfies the requirement numpy>=1.16 (from astropy)
ERROR: Could not find a version that satisfies the requirement numpy<1.16
ERROR: Could not find a version that satisfies the requirement numpy>=1.16 (from astropy)
ERROR: No matching distribution found for numpy, numpy, numpy, numpy

Astropy 4.0 requires Numpy >=1.16, so specifying explicitly numpy<1.16 leads to an error (as it should) - but the error message is not very clear (especially the last line which complains about numpy four times). As a user, I would ideally expect to see an error message along the lines of 'astropy>4.0' requires numpy>=1.16 which is incompatible with 'numpy<1.16' or something like this.

To be clear, in this situation the resolver is working fine, and in a case such as the following it does find combinations that work:

en% pip install "numpy<1.15" "astropy>3.0"
Collecting astropy>3.0
  Using cached astropy-4.0.1.post1-cp38-cp38-macosx_10_9_x86_64.whl (6.5 MB)
Collecting astropy>3.0
  Using cached astropy-4.0.1-cp38-cp38-macosx_10_9_x86_64.whl (6.5 MB)
Collecting astropy>3.0
  Downloading astropy-4.0-cp38-cp38-macosx_10_9_x86_64.whl (6.5 MB)
     |████████████████████████████████| 6.5 MB 9.4 MB/s 
Collecting astropy>3.0
  Downloading astropy-3.2.3-cp38-cp38-macosx_10_9_x86_64.whl (6.3 MB)
     |████████████████████████████████| 6.3 MB 7.1 MB/s 
Collecting numpy<1.15
  Downloading numpy-1.14.6.zip (4.9 MB)
     |████████████████████████████████| 4.9 MB 6.0 MB/s 
Using legacy setup.py install for numpy, since package 'wheel' is not installed.
Installing collected packages: numpy, astropy

So this issue is mainly to request more readable error output for cases where it doesn't work (to avoid the issue of conda resolution conflict logs which are unparsable by users).

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label May 29, 2020
@pfmoore
Copy link
Member

pfmoore commented May 29, 2020

Thanks for the report. We're actively looking at how to improve the error messages, and user feedback is really important in this exercise. So could I ask, what would have been helpful to include in the error in this case? If you can describe the key pieces of information you would have liked to see, that would be a great help. Or if you could give an example of the error you would have liked pip to display in this case, that would be really useful as well.

@astrofrog
Copy link
Author

What would be important for me would be to know in this specific case is which of the things I specified explicitly had conflicts. For instance if I had done pip install "numpy<1.16" "astropy>4.0" scipy matplotlib I would want the error message to be:

ERROR: 'astropy>4.0' requires numpy>=1.16 which is incompatible with 'numpy<1.16'

(that is, the error message should ideally include somewhere the original package requirements I typed). I realize this won't cover all cases of course, but this is just the information that is important to me in this case.

@pfmoore
Copy link
Member

pfmoore commented May 29, 2020

Thanks, that's useful to know. We can look at how to present that information in the error.

@DiddiLeija
Copy link
Member

HI! How is this issue going? Have we fixed it on a newer version of pip? Can we close it?

@ichard26 ichard26 added C: dependency resolution About choosing which dependencies to install state: needs eyes Needs a maintainer/triager to take a closer look C: error messages Improving error messages and removed S: needs triage Issues/PRs that need to be triaged labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages state: needs eyes Needs a maintainer/triager to take a closer look
Projects
None yet
Development

No branches or pull requests

4 participants