# ModuleNotFoundError：没有名为 'setuptools' 的模块

- **ID:** `python/setuptools-module-not-found`
- **领域:** python
- **类别:** module_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

当前 Python 环境中未安装 setuptools，通常出现在新的 virtualenv 或最小化 Docker 镜像中。

## 版本兼容性

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

## 解决方案

1. **** (98% 成功率)
   ```
   Install setuptools: `pip install setuptools`.
   ```
2. **** (90% 成功率)
   ```
   For Python 3.12+, use `python -m ensurepip --upgrade` to bootstrap pip and setuptools.
   ```

## 无效尝试

- **** — Overkill; setuptools is a separate package. (95% 失败率)
- **** — Does not install setuptools. (90% 失败率)
