# /path/to/venv/bin/python：没有名为 pip 的模块

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

## 根因

创建虚拟环境时未包含 pip（例如 python -m venv --without-pip，或 ensurepip 损坏），因此环境内无法使用 pip。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   source /path/to/venv/bin/activate
python -m ensurepip --upgrade
python -m pip install --upgrade pip
   ```
2. **** (98% 成功率)
   ```
   deactivate || true
rm -rf /path/to/venv
python -m venv /path/to/venv
source /path/to/venv/bin/activate
python -m pip --version
   ```

## 无效尝试

- **** — pip is not importable inside the venv, so the command itself fails before it can install anything. (95% 失败率)
- **** — Installs pip for the system Python, not for the broken virtual environment. (90% 失败率)
