# package-a 1.0.0 需要 package-b<2，但你已安装 package-b 2.3.0，不兼容。

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

## 根因

已安装的包（通过 conda、apt 或之前的 --no-deps 安装）违反了声明的依赖约束。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (92% 成功率)
   ```
   Create a fresh venv and reinstall: python -m venv .venv && . .venv/bin/activate && pip install -r requirements.txt
   ```
2. **** (85% 成功率)
   ```
   Pin the correct version: pip install 'package-b<2'
   ```
3. **** (80% 成功率)
   ```
   Audit with pip check and pipdeptree: pip install pipdeptree && pipdeptree --warn silence
   ```

## 无效尝试

- **** — Runtime imports may resolve to the wrong version and fail with AttributeError or ImportError. (70% 失败率)
- **** — Force-reinstall may pull in conflicting transitive deps and break other packages in the same env. (60% 失败率)
- **** — Removes the package you need instead of resolving the conflict. (95% 失败率)
