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

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

## 根因

当前 Python 环境中未安装 setuptools。

## 版本兼容性

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

## 解决方案

1. **Install setuptools using pip for the current Python** (95% 成功率)
   ```
   python -m pip install setuptools
   ```
2. **Ensure the virtual environment is activated** (90% 成功率)
   ```
   source venv/bin/activate && pip install setuptools
   ```

## 无效尝试

- **Installing setuptools with conda in a pip-only environment** — Conda and pip environments are separate; conda install may not affect pip's Python. (70% 失败率)
- **Using python -m pip install setuptools but without activating the correct venv** — If the wrong Python is used, setuptools may install elsewhere. (80% 失败率)
