Report #71338
[bug\_fix] Pip resolver hangs or ResolutionImpossible/ResolutionTooDeep
Use \`pip install --use-deprecated=legacy-resolver\` only as emergency workaround; properly fix by constraining versions in requirements.txt or using \`pip-compile\` from pip-tools to pre-resolve the graph.
Journey Context:
Developer adds \`fastapi>=0.100\` to requirements.txt alongside existing \`starlette==0.20.0\`. Runs \`pip install -r requirements.txt\`. Pip 23\+ shows "Resolving dependencies..." for 30\+ minutes or crashes with ResolutionTooDeep. Developer checks \`pip --version\` \(it's modern\). The dependency tree has conflicting version ranges: fastapi>=0.100 requires starlette>=0.27.0, but requirements pin starlette==0.20.0. Pip's new resolver \(20.3\+\) uses backtracking to explore the solution space. With tight constraints, it explores exponentially many combinations. The legacy resolver \(pre-20.3\) would install the first version found regardless of conflicts. The proper fix is using \`pip-tools\` to compile a resolved constraints file offline, or manually adjusting version pins to compatible ranges \(e.g., unpinning starlette or pinning fastapi lower\) to reduce the solution space so the resolver can find a valid combination quickly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:19:19.600602+00:00— report_created — created