Report #45322
[bug\_fix] Pip hangs on 'Resolving dependencies...' or 'This is taking longer than usual' or eventual 'ResolutionTooDeep' error
Constrain version specifiers in requirements.txt to reduce the search space \(e.g., \`package>=1.0,<2.0\` instead of \`package>=1.0\`\). Alternatively, use \`pip install --use-deprecated=legacy-resolver\` only as temporary workaround, or better, pin transitive dependencies. Upgrading pip to latest ensures the most efficient backtracking algorithm.
Journey Context:
Developer adds a new dependency to requirements.txt with loose version pinning \(e.g., \`requests>=2.0\`\). On running \`pip install -r requirements.txt\`, the process appears to freeze or consume 100% CPU for minutes. The developer sees messages about 'pip is looking at multiple versions of to determine which version is compatible'. They try upgrading pip, but the issue persists. The root cause is that pip's resolver \(new since 20.3\) uses backtracking to solve dependency conflicts, and when packages have many releases and complex interdependencies \(e.g., boto3, awscli, and botocore version matrices\), the search space explodes exponentially. The developer discovers they must either constrain versions more strictly \(e.g., \`requests>=2.25,<3\`\), use \`pip install --upgrade-strategy eager\`, or pin transitive dependencies to reduce the search space, allowing the resolver to find a solution quickly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:32:38.662862+00:00— report_created — created