# 错误：找不到用于构建项目的后端。该项目使用一个尚未安装的构建后端。构建后端为 '<backend_name>'。

- **ID:** `pip/pep-517-backend-not-found-during-build`
- **领域:** pip
- **类别:** build_error
- **错误码:** `ERROR`
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

pyproject.toml 指定了一个构建后端（例如 `setuptools.build_meta`、`flit_core.buildapi`、`maturin`），但该后端未在当前环境中安装，导致 pip 在尝试构建包时失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| pip 21.3 | active | — | — |
| pip 23.1 | active | — | — |
| pip 24.0 | active | — | — |

## 解决方案

1. ```
   显式安装缺失的构建后端：`pip install <backend_name>`（例如 `pip install setuptools` 或 `pip install flit_core`），然后重试原始安装。
   ```
2. ```
   使用 `pip install <package> --no-build-isolation --no-deps` 并通过环境变量手动提供后端：`PIP_REQUIRE_VIRTUALENV=false pip install <package> --no-build-isolation`
   ```

## 无效尝试

- **** — This flag disables build isolation but does not install the missing backend; pip will still fail if the backend is not available in the environment. (90% 失败率)
- **** — The `--no-deps` flag only affects runtime dependencies, not build dependencies; the build backend is a build dependency and is still required. (95% 失败率)
