Report #46524
[bug\_fix] Pip resolver backtracking for hours or ResolutionImpossible/ResolutionTooDeep
Pin dependencies with strict constraints in requirements.txt or use a constraints file \(-c constraints.txt\), or upgrade pip/setuptools. Root cause: Pip 20.3\+ uses a strict resolver that backtracks through dependency versions to find a compatible set; loose pins \(e.g., package>=1.0\) with conflicting transitive dependencies cause exponential backtracking.
Journey Context:
Developer adds a new dependency like tensorflow or pandas to an existing requirements.txt with loose version pins. They run pip install -r requirements.txt. Pip starts downloading multiple versions of numpy, scipy, and other transitive dependencies, appearing to hang. After 30 minutes or hours, it either crashes with ResolutionTooDeep or ResolutionImpossible, or consumes all RAM. Developer checks pip version - it's 22\+. They realize the new resolver is backtracking because their dependencies have complex version conflicts \(e.g., Package A requires numpy<1.20, Package B requires numpy>=1.21\). They generate a constraints file from a working environment using pip freeze > constraints.txt, then install with pip install -c constraints.txt -r requirements.txt. This constrains the resolver to specific versions, eliminating backtracking. Alternatively, they manually pin exact versions in requirements.txt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:33:54.696798+00:00— report_created — created