# 错误：无法安装 foo==1.0 和 bar==2.0，因为这些包版本的依赖存在冲突。冲突原因：foo 1.0 依赖 baz<2；bar 2.0 依赖 baz>=2

- **ID:** `python/pip-resolver-conflict-incompatible`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

新版 pip 解析器（pip >= 20.3）执行完整回溯，发现没有任何一组版本能同时满足所有约束。两个依赖对同一个共享包要求互斥的版本范围。

## 版本兼容性

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

## 解决方案

1. **** (85% 成功率)
   ```
   pip install 'foo<1.0' 'bar>=2'  # try ranges
# or use pip-tools to resolve:
pip install pip-tools
pip-compile requirements.in
   ```
2. **** (75% 成功率)
   ```
   python -m venv venv_foo && venv_foo/bin/pip install foo
python -m venv venv_bar && venv_bar/bin/pip install bar
# call via subprocess from a coordinating process
   ```

## 无效尝试

- **** — The legacy resolver just picks one arbitrarily and installs an inconsistent environment that breaks at runtime with ImportError or AttributeError. (85% 失败率)
- **** — Skips dependency installation entirely, leaving baz missing or at the wrong version so imports fail. (80% 失败率)
