# 错误：尝试调用 'setup.py' 时后端子进程退出。

- **ID:** `python/pip-fallback-to-legacy-setup-py`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pip 默认使用 PEP 517 构建隔离，但项目的 pyproject.toml 缺少 build-system 表，导致回退到旧的 setup.py 方式，因依赖缺失而失败。

## 版本兼容性

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

## 解决方案

1. **Add build-system table to pyproject.toml** (95% 成功率)
   ```
   Add to pyproject.toml:
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
   ```
2. **Use --no-build-isolation flag** (85% 成功率)
   ```
   pip install --no-build-isolation <package>
   ```

## 无效尝试

- **Reinstalling setuptools globally with pip install --upgrade setuptools** — Global upgrade doesn't fix the build-time dependency issue caused by PEP 517 isolation. (70% 失败率)
- **Deleting pyproject.toml entirely** — Removing the file doesn't help; pip will still try to use legacy setup.py without proper environment. (90% 失败率)
