Report #104701
[bug\_fix] pip resolver dependency conflicts causing \`ERROR: Cannot install -r requirements.txt \(line XX\) because these package versions have conflicting dependencies\` specifically due to transitive pinning of a core library like \`numpy\` or \`requests\`
Run \`pip install --upgrade pip setuptools wheel\`, then use \`pip install -r requirements.txt --resolver=backtracking\` \(pip <20.3\) or simply \`pip install -r requirements.txt\` \(pip >=20.3, which uses backtracking by default\). If conflicts persist, manually audit the transitive dependencies via \`pipdeptree\` and relax upper-bound pins in requirements.
Journey Context:
A data science team had a \`requirements.txt\` that pinned \`numpy==1.21.0\` and \`tensorflow==2.8.0\`. When a developer ran \`pip install -r requirements.txt\` in a fresh venv on Python 3.9, pip produced a long conflict error involving \`numpy\` and \`pandas\` \(which depended on \`numpy>=1.21.2\`\). The team initially tried adding \`--no-deps\`, which broke the install. They then manually installed tensorflow first, then pandas, which worked but left an inconsistent environment. The root cause was that the pip resolver \(pre-20.3\) used a greedy algorithm that stopped at the first conflict, while the backtracking resolver explores alternative dependency trees. The established fix was to upgrade pip \(to >=20.3\) and let the new resolver backtrack through versions, which successfully found a working set of dependencies. The team also ran \`pipdeptree\` to document the actual resolved graph for future maintenance.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-27T20:11:41.029852+00:00— report_created — created