Report #67822
[bug\_fix] pip install hangs with 'Collecting packageX' cycling through versions, or ResolutionImpossible: unable to find installation candidates satisfying constraints
Use a constraints file to restrict the solution space for problematic transitive dependencies: \`pip install -c constraints.txt -r requirements.txt\`. Populate constraints.txt with known compatible versions \(e.g., \`numpy<2.0\`\) to prevent pip from backtracking through incompatible versions. Alternatively, upgrade pip to latest \(\`pip install -U pip\`\) to ensure the resolver has latest optimizations.
Journey Context:
Developer adds \`tensorflow>=2.0\` to requirements.txt alongside existing \`numpy>=1.19\`. Running \`pip install -r requirements.txt\` starts checking 'Collecting numpy>=1.19', then 'Collecting numpy>=1.20', then 'Collecting numpy>=1.21', etc., for dozens of versions of multiple packages. The terminal hangs for 30 minutes. Developer checks \`pip --version\` and sees 20.2 \(pre-resolver change\) or sees 23.x but with loose constraints. The issue is that TensorFlow has strict upper bounds on numpy that aren't immediately obvious, and pip's backtracking algorithm is trying every version of numpy to find one compatible with all other packages. By adding a constraint \`numpy<1.24\` \(known to work with that TF version\), the search space collapses and resolution completes in seconds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:19:20.856916+00:00— report_created — created