# 错误：pip 的依赖解析器目前未考虑所有已安装的包。此行为是以下依赖冲突的来源。
foo 1.0 需要 bar>=2.0，但您安装的是 bar 1.5，不兼容。

- **ID:** `python/pip-target-directory-not-in-path`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

某个包使用 --target 或 --ignore-installed 安装，导致 pip 对环境的视图不完整，无法在解析期间检测到冲突。

## 版本兼容性

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

## 解决方案

1. **** (85% 成功率)
   ```
   Inspect the conflict and pin compatible versions:
  pip check
  pip install 'bar>=2.0'
Then re-verify: pip check
   ```
2. **** (90% 成功率)
   ```
   Reinstall the affected packages without --target/--ignore-installed into a clean venv:
  python -m venv .venv && source .venv/bin/activate
  pip install foo
   ```

## 无效尝试

- **** — Upgrading bar may break foo if foo's constraint is also unsatisfiable with the new bar; the root cause is the incomplete environment view. (60% 失败率)
- **** — No such flag; pip check has no ignore option. (95% 失败率)
