# 错误：pip 的依赖解析器目前未考虑所有已安装的包。此行为是以下依赖冲突的根源。
foo 1.0 要求 bar<2，但你安装了 bar 2.1，不兼容。

- **ID:** `python/pip-conflicting-dependencies-backtracking`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

现有环境中已包含与新安装包冲突的包版本；解析器仅发出警告，而不会修复已有的安装。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   python -m venv .venv && source .venv/bin/activate
pip install pip-tools
pip-compile requirements.in
pip-sync requirements.txt
   ```
2. **** (90% 成功率)
   ```
   pip install 'foo==1.0' 'bar<2'
pip check
   ```

## 无效尝试

- **** — Upgrades both without regard to the constraint; may re-trigger the same conflict or introduce new ones. (70% 失败率)
- **** — Force-reinstall does not resolve version constraints; the same incompatible pair is reinstalled. (85% 失败率)
