# 错误：找不到文件 "setup.py"。没有构建后端时无法执行可编辑安装。

- **ID:** `python/pip-editable-install-missing-pyproject`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pip install -e . 需要 setup.py 或 pyproject.toml 中的 [build-system] 表来定义支持可编辑安装的后端。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Add a build-system table to pyproject.toml: [build-system]\nrequires = ["setuptools>=61", "wheel"]\nbuild-backend = "setuptools.build_meta"
   ```
2. **** (90% 成功率)
   ```
   Use a hatchling backend for pure-Python projects: [build-system]\nrequires = ["hatchling"]\nbuild-backend = "hatchling.build"
   ```
3. **** (92% 成功率)
   ```
   Migrate to a PEP 621 [project] table and re-run pip install -e .
   ```

## 无效尝试

- **** — An empty setup.py declares no package metadata, so the editable install produces no importable package. (85% 失败率)
- **** — Disabling isolation does not provide a build backend; the error persists. (90% 失败率)
- **** — Installs a copy, so source edits are not reflected, defeating the purpose of -e. (70% 失败率)
