Report #97716
[bug\_fix] pip dependency resolver backtracks forever or fails with \`ResolutionImpossible\` on conflicting transitive requirements
Pin the conflicting top-level packages to compatible versions in \`requirements.txt\` or \`pyproject.toml\`, then run \`pip install -r requirements.txt\` or \`pip install .\` again. If the conflict is between \`pkg\_a<2\` and \`pkg\_a>=2\`, choose a version of one top-level package that loosens the constraint. The root cause is that pip's resolver \(since 20.3\) is correct but exhaustive: it tries every version of a dependency to satisfy all constraints, and constraints from different packages can be mutually exclusive.
Journey Context:
You add a new package to requirements and \`pip install\` spins for minutes downloading old versions. It finally prints \`ResolutionImpossible\` with a long list of \`pkg\_a<2\` required by \`old-lib\` and \`pkg\_a>=2\` required by \`new-lib\`. You try \`--use-deprecated=legacy-resolver\` and it installs but the app crashes at runtime because the versions really are incompatible. You then inspect \`pip install -r requirements.txt --dry-run\` and \`pipdeptree\` to find which direct dependency pulled in the conflicting ranges. Pinning \`old-lib\` to a newer release that supports \`pkg\_a>=2\` gives pip a solvable constraint graph.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:34:50.806098+00:00— report_created — created