Skip to content

Resolving rejects all wheels for a given version causing otherwise valid wheels to be missed. #13608

@dstufft

Description

@dstufft

Description

Given these wheels and dependencies:

root -> a == 1
root -> b == 1
b-1-py3-none-any.whl -> a == 2
b-1-py2.py3-none-any.whl -> a == 1

If you run a command like pip install a==1 b==1 then whether or not the resolving succeeds or not depends on whether it "saw" b-1-py3-none-any.whl or b-1-py2.py3-none-any.whl first.

It appears that when resolvelib rejects the first b 1 wheel it finds, it rejects b==1 as a whole, even though the second wheel in that set might resolve fine.

Expected behavior

I expect pip to select the wheel that makes the resolution able to succeed, or at least have consistent behavior regardless of which wheel it sees "first".

In the above scenario, b==1 a==1 and b==1 a==2 should be resolvable on py3.

pip version

25.2

Python version

3.13.3

OS

Linux

How to Reproduce

  1. Clone https://github.com/dstufft/pip-wheel-resolver-test
  2. Run pip install --dry-run --no-index --find-links=file://$PWD/index a==1 b==1.
  3. Run pip install --dry-run --no-index --find-links=file://$PWD/index a==2 b==1.

Output

$ pip install --dry-run --no-index --find-links file://$PWD/index/ a==1 b==1
Looking in links: file:///home/dstufft/projects/pip-wheel-resolver-test/index/
Processing ./index/a-1-py3-none-any.whl
Processing ./index/b-1-py2.py3-none-any.whl
Would install a-1 b-1

$ pip install --dry-run --no-index --find-links file://$PWD/index/ a==2 b==1
Looking in links: file:///home/dstufft/projects/pip-wheel-resolver-test/index/
Processing ./index/a-2-py3-none-any.whl
Processing ./index/b-1-py2.py3-none-any.whl
INFO: pip is looking at multiple versions of b to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install a==2 and b==1 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested a==2
    b 1 depends on a==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 to 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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions