Report #11214
[bug\_fix] pip install appears to hang or outputs 'Collecting package...' indefinitely with 'INFO: pip is looking at multiple versions of X to determine which version is compatible'
Constrain the dependency tree by providing explicit version pins or a constraints file \(\`-c constraints.txt\`\) for the packages causing the backtracking. The pip resolver \(since 20.3\) uses a strict backtracking algorithm to find a compatible set; when transitive dependencies have conflicting version ranges \(e.g., Package A requires urllib3<2, Package B requires urllib3>=2\), the resolver tries every intermediate version to find a solution, causing exponential time complexity. Pinning breaks the ambiguity by forcing a specific version, shortcutting the search.
Journey Context:
Your CI pipeline that used to install in 30 seconds now times out after 10 minutes at the 'pip install -r requirements.txt' step. Locally, you run pip with verbose flag \(\`-vvv\`\) and see it cycling through 'Collecting urllib3' versions 1.26.0, 1.26.1, ... up to 2.0.0, then backtracking to try 'charset-normalizer' versions. You realize you recently added \`requests==2.28.0\` while another legacy dependency pins \`urllib3<1.27\`. The resolver is trying to find a version of \`requests\` compatible with both constraints, downloading every wheel in between. You create a \`constraints.txt\` pinning \`urllib3==1.26.15\` and \`requests==2.28.1\` that satisfies both ranges, and the install completes in 15 seconds because the resolver no longer needs to explore the version space.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:47:16.767062+00:00— report_created — created