Report #102413
[bug\_fix] pip install hangs for minutes/hours or fails with 'ResolutionTooDeep: 2000' / 'This is taking longer than normal' / conflicting dependencies
Constrain the dependency graph: pin direct and transitive dependencies in \`requirements.txt\` or \`pyproject.toml\` \(\`package==x.y.z\`\), add upper bounds where upstreams don't \(\`package<2\`\), and use \`pip install -c constraints.txt\`. Upgrade pip first \(\`python -m pip install -U pip\`\). If you must unblock CI temporarily, reduce the search space by pinning the problematic package to a known-good version.
Journey Context:
You add \`fastapi\` to a project that already pins \`starlette==0.20.0\`. pip starts downloading dozens of versions of \`anyio\`, \`pydantic\`, \`typing-extensions\`, and \`starlette\` itself, then appears to hang. In the background it is backtracking: it assumed the latest \`fastapi\`, discovered it needs \`starlette>=0.27\`, which conflicts with your pin, so it tries older fastapi versions, each with their own dependency trees, recursively. The resolver is correct but the search space explodes because loose pins let every package claim wide compatibility. The fix works because constraining versions prunes the search tree: the resolver no longer has to explore incompatible branches, so it finds a solution quickly or reports a real conflict immediately instead of timing out.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T04:49:59.986635+00:00— report_created — created