question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip needs a dependency resolver

See original GitHub issue

pip’s dependency resolution algorithm is not a complete resolver. The current resolution logic has the following characteristics:

  • Only one top level specification of a requirement (otherwise pip raises a “double requirement” exception)
  • “first found wins” behavior for dependency requirements/constraints, which results in not respecting all constraints. pip 10+ print a warning when this occurs.

NOTE: In cases where the first found dependency is not sufficient, specifying the constraints for the dependency on the top level can be used to make it work.

pip install project "dependency>=1.5,<2.0"

(2019-06-23)

This is being worked on by @pradyunsg, in continuation of his GSoC 2017 project. A substantial amount of code cleanup has been done, and is ongoing, to make it tractable replace the current resolver, in a reasonable manner. This work enabled pip >= 10 to warn when it is going to make an installation that breaks the dependency graph. (The installations are not aborted in such scenarios, for backwards compatibility.)


(2019-11-29)

A status update regarding this is available here.


(2022-12-16)

See the closing note for details.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Reactions:390
  • Comments:179 (91 by maintainers)

github_iconTop GitHub Comments

155reactions
pradyunsgcommented, Nov 30, 2020

That felt goooood. 😃

74reactions
pradyunsgcommented, Jan 26, 2018

Hey everyone! Hope you’ve had a great start to 2018!

This issue has been quiet for a while now and I have stuff worth telling. 😃

There’s a branch of pip that is capable of printing a warning when an incompatible set of packages is going to be installed. I’m not completely sure if the UX is good enough, so I’m seeking input on this behaviour; whether it is indeed something that would be an improvement over the status quo, what can be potential improvements to it etc. I’d appreciate any feedback on it over on https://github.com/pradyunsg/pip/issues/1.

As for proper resolution, all the preparatory refactoring that was needed on pip’s side is basically done (it’s what made the validation stuff mentioned above much easier to do). It was much more work than I’d anticipated initially.

I’m working on the resolver separately now and will bring it into pip once it’s ready. What has been implemented currently already handles whatever I’ve thrown at it yet, including interesting situations with cycles and optional dependencies (extras). If you have a situation where pip 9’s resolver does the wrong thing or causes issues, I’d really appreciate it if you could file an issue over at the zazo, detailing the project and versions involved to help make sure that zazo’s resolver will Do The Right Thing™ (especially if there’s a large number of projects and versions).

Cheers!

edit: Look, 100th comment!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependency Resolution - pip documentation v22.3.1
pip is capable of determining and installing the dependencies of packages. The process of determining which version of a dependency to install is...
Read more >
pip's dependency resolver takes way too long to solve the ...
INFO: pip is looking at multiple versions of <Python from requires-Python> to determine which version is compatible with other requirements.
Read more >
Understanding Python Packages pip Dependency Resolver ...
When we install a package like this – pip install Flask – pip needs to work out Flask's dependencies, the dependencies of those...
Read more >
Dependency Management with Pip, Python's Package Manager
Pip does not provide true dependency resolution, but this can be solved by using it in conjunction with a requirements.txt file.
Read more >
dependencies-resolver - PyPI
dependencies -resolver 0.0.11. pip install dependencies-resolver. Copy PIP instructions ... dependencies_resolver_ve/bin/pip install -r requirements.txt ...
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found