# 错误：无法安装 -r requirements.txt 和 foo==1.0，因为这些包版本存在依赖冲突。

错误：ResolutionImpossible：帮助参见 https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

- **ID:** `python/pip-legacy-setup-py-install-removed`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

现代 pip 解析器找不到满足所有固定约束的版本集合，通常由于 requirements 过度固定或传递依赖的版本固定相互矛盾。

## 版本兼容性

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

## 解决方案

1. **** (80% 成功率)
   ```
   Relax pins to ranges (`foo>=1.0,<2`) and re-resolve; use `pip install -r requirements.txt --dry-run` to preview.
   ```
2. **** (90% 成功率)
   ```
   Use a resolver-aware tool: `pip-compile requirements.in` or `uv pip compile` to compute a consistent lockfile.
   ```

## 无效尝试

- **** — Installs incompatible versions and only defers the failure to runtime. (60% 失败率)
- **** — May break reproducibility and still conflict transitively. (50% 失败率)
