# 需求已满足：requests 位于 ./venv/lib/python3.11/site-packages (2.31.0)

>>> import requests
ModuleNotFoundError: 没有名为 'requests' 的模块

- **ID:** `python/pip-requirement-already-satisfied-but-import-fails`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pip 安装到了与运行代码不同的解释器/site-packages（例如 `pip` 与 `python -m pip` 不一致，或 venv 不匹配），因此导入路径不包含安装位置。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   Always install via the target interpreter: `python -m pip install requests`, and confirm with `python -c 'import sys; print(sys.executable)'`.
   ```
2. **** (90% 成功率)
   ```
   Check which pip: `which pip` vs `python -m pip --version`; recreate the venv and activate it before installing.
   ```

## 无效尝试

- **** — Installs into the same wrong interpreter again. (90% 失败率)
- **** — Fragile and breaks when the environment changes. (60% 失败率)
