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

Confusing conflict message error message when pip can't build metadata for any version of package required #10478

Closed
1 task done
notatallshaw opened this issue Sep 15, 2021 · 6 comments
Labels
C: error messages Improving error messages type: feature request Request for a new feature

Comments

@notatallshaw
Copy link
Member

notatallshaw commented Sep 15, 2021

Description

I was testing the following installation failure in #10473 . It fails to install because one of the dependencies (weblogo) requires numpy to be installed to run it's setup.py and it skips over each version of weblogo and then attempts backtracking down the wrong path.

ERROR: Cannot install dms-tools2 because these package versions have conflicting dependencies.

The conflict is caused by:
    phydms 2.4.1 depends on weblogo<3.6 and >=3.4
    phydms 2.4.0 depends on weblogo<3.6 and >=3.4
    phydms 2.3.8 depends on weblogo<3.6 and >=3.4
    phydms 2.3.7 depends on weblogo<3.6 and >=3.4
    phydms 2.3.6 depends on weblogo<3.6 and >=3.4
    phydms 2.3.5 depends on weblogo<3.6 and >=3.4
    phydms 2.3.4 depends on weblogo<3.6 and >=3.4
    phydms 2.3.3 depends on weblogo<3.6 and >=3.4
    phydms 2.3.2 depends on weblogo<3.6 and >=3.4
    phydms 2.3.1 depends on weblogo<3.6 and >=3.4
    phydms 2.3.0 depends on weblogo<3.6 and >=3.4
    phydms 2.2.2 depends on weblogo<3.6 and >=3.4
    phydms 2.2.1 depends on weblogo<3.6 and >=3.4
    phydms 2.2.0 depends on weblogo<3.6 and >=3.4
    phydms 2.1.4 depends on weblogo<3.6 and >=3.4
    phydms 2.1.3 depends on weblogo<3.6 and >=3.4
    phydms 2.1.2 depends on weblogo<3.6 and >=3.4

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

Expected behavior

It would be useful to let the user know that the reason this is conflicting is because there were no valid installs avaiable for these version numbers, e.g.:

The conflict is caused by:
    phydms 2.4.1 depends on weblogo<3.6 and >=3.4 (no valid package available)
    phydms 2.4.0 depends on weblogo<3.6 and >=3.4 (no valid package available)
    ...

Given what I know about the pip code base this is probably tricky to implement? But I do think it's difficult for the user to parse the error message right now as pip is giving non-conflicting dependencies and saying they are conflicting.

pip version

21.3.1

Python version

all

OS

all

How to Reproduce

  1. On Linux
  2. sudo apt-get install build-essential
  3. python3 -m venv .venv
  4. source activate ./venv/bin/activate
  5. python -m pip install Cython (one of the other dependencies depends on Cython otherwise you get a similar error but with pysam instead of weblogo)
  6. python -m pip install dms-tools2

Output

No response

Code of Conduct

Edit: Note I edited this first post to reflect the current situation.

@notatallshaw notatallshaw added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Sep 15, 2021
@notatallshaw notatallshaw changed the title Confusing error message when pip can't install because dependency has setup.py error Confusing error message when pip can't resolve because dependency has setup.py error Sep 15, 2021
@DiddiLeija
Copy link
Member

I think this could be a feature request related to error messages, right?

@DiddiLeija DiddiLeija added C: error messages Improving error messages type: feature request Request for a new feature and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Sep 20, 2021
@notatallshaw
Copy link
Member Author

I think this could be a feature request related to error messages, right?

Yes, in retrospect I should of raised it as a feature request. Thanks for changing.

@uranusjr
Copy link
Member

Maybe failed to build package from source would be easier to understand for users? Not sure about the best wording here, the overall idea sounds good to me.

@notatallshaw notatallshaw reopened this Sep 21, 2021
@notatallshaw notatallshaw changed the title Confusing error message when pip can't resolve because dependency has setup.py error Confusing conflict message error message when pip can't build metadata for any version of package required Nov 12, 2021
@notatallshaw notatallshaw reopened this Mar 11, 2022
@notatallshaw
Copy link
Member Author

Whoops, accidentally closed this thinking it was slightly different issue than I remembered, reopened.

@pradyunsg
Copy link
Member

This should no longer happen. If a build fails, pip 22.0+ now abort immediately.

Closing this, since I don't think we'd see this anymore. If someone sees this still with 22.0, please file a new issue with clear reproduction steps!

@notatallshaw
Copy link
Member Author

Yeah that's why I closed it, but then I was a bit unsure and thought there might still be a way to reproduce it. I'll have a think and open a new issue if there's a specific way to reproduce it still.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 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 type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants