# 错误：无法安装 packageA 和 packageB，因为这些包的版本有冲突的依赖。

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

## 根因

两个或多个包需要不兼容版本的共享依赖，导致解析冲突。

## 版本兼容性

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

## 解决方案

1. **Let pip automatically find a compatible set.** (70% 成功率)
   ```
   pip install packageA packageB --upgrade --upgrade-strategy eager
   ```
2. **Isolate conflicting packages in separate environments.** (90% 成功率)
   ```
   python -m venv env1 && source env1/bin/activate && pip install packageA
   ```

## 无效尝试

- **Using pip install --ignore-dependencies packageA packageB** — Ignores all dependency checks, often leading to runtime import errors. (80% 失败率)
- **Using pip install --no-deps packageA packageB** — Installs packages without their dependencies, causing missing modules. (85% 失败率)
