Report #61012
[bug\_fix] pip dependency resolver backtracking \(ResolutionTooDeep or infinite hang\)
Upgrade pip to >= 20.3 \(where the new resolver is default\), then either constrain the problematic dependency with a specific version \(e.g., \`pip install 'requests<2.28'\`\) or use a constraints file \(\`-c constraints.txt\`\) to pin transitive dependencies and limit the search space.
Journey Context:
A developer on pip 20.0.2 runs \`pip install apache-airflow\[all\]\`. The process consumes 6GB RAM and hangs for 20 minutes. The developer force-kills it and sees a \`ResolutionTooDeep\` error in the logs. Investigating, they learn that pip 20.0 used a legacy resolver that could produce broken environments, while pip 20.3 introduced a new backtracking resolver that is correct but can be slow on complex constraints. Upgrading pip to 23.x reveals a clear \`ResolutionImpossible\` message showing that \`package-A\` requires \`requests>=2.28\` while \`package-B\` requires \`requests<2.27\`. The developer creates a \`constraints.txt\` with \`requests==2.28.1\` \(which satisfies both lower bounds if possible\) or recognizes the incompatibility and pins specific versions to bypass the combinatorial explosion, allowing the resolver to finish instantly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:53:45.142709+00:00— report_created — created