pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.45k stars 3k forks source link

ResolutionImpossible states it wants to install two different versions of the same package #11994

Open notatallshaw opened 1 year ago

notatallshaw commented 1 year ago

Description

Get an ResolutionImpossible error that states Cannot install glue-vispy-viewers==1.0.6 and glue-vispy-viewers==1.0.7 because these package versions have conflicting dependencies

Expected behavior

Getting a ResolutionImpossible is probably correct but it's confusing that it states it wants to install two different versions of the same package.

pip version

23.1.1

Python version

3.9.13

OS

Windows

How to Reproduce

  1. py -3.9 -m pip download glue-vispy-viewers -d .\download --only-binary=:all: --platform win32

Output

ERROR: Cannot install glue-vispy-viewers==1.0.6 and glue-vispy-viewers==1.0.7 because these package versions have conflicting dependencies.

The conflict is caused by:
    glue-vispy-viewers 1.0.7 depends on vispy>=0.9.1
    glue-vispy-viewers 1.0.6 depends on vispy>=0.9.1

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/topics/dependency-resolution/#dealing-with-dependency-conflicts

Code of Conduct

notatallshaw commented 1 year ago

The rich traceback: https://gist.github.com/notatallshaw/93b9fe5063609e8313eb9c81a7049495

The verbose output (with Skipping Link and Found Link lines removed because Gist cut off after ~2500 lines): https://gist.github.com/notatallshaw/65f01e5706a207f2afa86edc4a9b6b83

notatallshaw commented 4 weeks ago

So this issue is caused by the fact that vispy is available for the specified conditions (only binary and win32) but only earlier versions than glue-vispy-viewers requires.

I think this is a subset of other open issues (which I can't find right at this moment) that when you get a resolution impossible error pip does not sufficently highlight that no versions of a particular package are available given the requirements.

Someone would need to take a look at how the reporter events from resolvelib, and resolution impossible exceptions are handeled and see if there's something more obvious that could be added.