# 错误：无法安装 package1==1.0 和 package2==2.0，因为这些包版本存在冲突的依赖关系。

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

## 根因

两个或多个包需要不兼容版本的公共依赖。

## 版本兼容性

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

## 解决方案

1. **** (80% 成功率)
   ```
   pip install package1 package2 --upgrade --constraint constraints.txt
   ```
2. **** (85% 成功率)
   ```
   python -m venv venv && source venv/bin/activate && pip install package1==1.1 package2==1.9
   ```

## 无效尝试

- **** — Ignores the conflict but may cause runtime errors due to missing or wrong dependency versions. (70% 失败率)
- **** — The conflict remains; pip will still raise the error when resolving the full set. (90% 失败率)
