Report #59309
[bug\_fix] pip install hangs with 'Collecting package...' for hours or ResolutionImpossible
Constrain the dependency tree by adding explicit version pins to top-level requirements \(e.g., \`pip install "numpy<2" "pandas==2.1.0"\`\) or use a constraints file \(\`-c constraints.txt\`\) to guide the resolver. Upgrade pip to the latest version. The root cause is that pip's resolver \(since 20.3\) uses a strict backtracking algorithm to satisfy all declared dependencies; when packages have conflicting version requirements \(e.g., pkg-A requires X>=2.0, pkg-B requires X<2.0\), the resolver iterates through many versions of X trying to find a compatible solution, appearing to hang or eventually raising ResolutionImpossible.
Journey Context:
A data scientist starts a new project and runs \`pip install tensorflow\` in a fresh virtual environment. They notice pip starts downloading many versions of \`numpy\` \(1.19, 1.20, 1.21...\), slowing down dramatically. After 30 minutes, they check the logs and see it's trying \`tensorflow\` which requires specific numpy versions, conflicting with another package they installed earlier \(\`scipy\`\). They try \`pip install --no-deps\` but that breaks imports at runtime. Searching reveals pip's resolver is backtracking through dependency hell. They realize they need to specify compatible versions upfront. By pinning \`numpy==1.24.3\` and \`tensorflow==2.15.0\` explicitly, they constrain the search space, allowing the resolver to find a compatible set instantly instead of exploring the combinatorial explosion of version ranges.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:02:29.675811+00:00— report_created — created