# RuntimeError: Setuptools 版本 58.0.0 太旧，无法使用 pyproject.toml 构建系统。最低要求是 60.0.0。

- **ID:** `python/setuptools-version-mismatch`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

安装的 setuptools 版本不支持 pyproject.toml 中定义的构建系统。

## 版本兼容性

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

## 解决方案

1. **Upgrade setuptools to a compatible version** (95% 成功率)
   ```
   pip install --upgrade setuptools>=60.0.0
   ```
2. **Use a virtual environment with a newer Python version** (90% 成功率)
   ```
   python3.11 -m venv venv && source venv/bin/activate && pip install setuptools
   ```

## 无效尝试

- **Downgrading pip** — The issue is with setuptools, not pip; downgrading pip does not help. (90% 失败率)
- **Removing pyproject.toml** — setuptools may fall back to setup.py, but modern packages rely on pyproject.toml. (70% 失败率)
