Report #62404
[bug\_fix] pip install hangs or fails with ResolutionImpossible due to dependency backtracking
The root cause is that pip's strict dependency resolver \(enabled by default since pip 20.3\) cannot find a consistent set of package versions that satisfies all constraints in your requirements. If your 'requirements.txt' pins an old version of a package \(e.g., 'numpy<1.20'\) while other packages require 'numpy>=1.22', the resolver exhaustively searches for a combination that doesn't exist \(backtracking\). The fix is to identify the conflicting constraints using 'pip install -r requirements.txt --verbose' and relax or update the pins to compatible versions \(e.g., remove the 'numpy<1.20' pin\). For long-term stability, use a lock file generated by 'pip-compile' \(pip-tools\) or 'poetry' to freeze a resolved dependency tree.
Journey Context:
Developer adds a new package to 'requirements.txt' and pushes to CI. The 'pip install' step suddenly takes 30 minutes and fails with 'ResolutionImpossible: for package pandas, found versions ... but these conflict with numpy<1.20'. Locally, it worked last week. The developer realizes they recently upgraded pip in CI to 23.x, while locally they were on 19.x \(legacy resolver\). They search and find the '--use-deprecated=legacy-resolver' flag, which makes the install pass instantly. However, they realize this is masking the real problem: 'pandas' 2.0 requires 'numpy>=1.22', but their 'requirements.txt' has 'numpy==1.19' pinned from two years ago. They must either upgrade numpy \(and fix breaking changes\) or pin 'pandas<2.0'. The rabbit hole teaches them about transitive dependency conflicts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:13:55.576052+00:00— report_created — created