ERROR pip build_error ai_generated true

错误:找不到满足 pyproject.toml 构建系统要求中 setuptools>=40.8.0 的版本

ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from pyproject.toml build-system.requires)

ID: pip/pep-517-build-backend-missing

其他格式: JSON · Markdown 中文 · English
85%修复率
87%置信度
1证据数
2023-06-05首次发现

版本兼容性

版本状态引入弃用备注
pip 23.0 active
pip 24.1 active
pip 24.3 active

根因分析

项目的 pyproject.toml 指定了一个构建后端(例如 setuptools)及其版本约束,但 pip 在可用索引中找不到该后端的任何版本,通常是因为索引不可达或包名拼写错误。

English

The project's pyproject.toml specifies a build backend (e.g., setuptools) with a version constraint, but pip cannot find any version of that backend in the available indexes, often because the index is unreachable or the package name is misspelled.

generic

官方文档

https://pip.pypa.io/en/stable/topics/build-system/

解决方案

  1. 确保索引 URL 可访问且包含所需后端:pip install --index-url https://pypi.org/simple setuptools>=40.8.0
  2. 在 pyproject.toml 中指定自定义索引或通过 PIP_EXTRA_INDEX_URL 指定额外索引 URL,如果后端托管在私有索引上。
  3. 如果项目简单,降级 pip 以支持传统的 setup.py 安装:pip install pip==21.3.1 && pip install <package>

无效尝试

常见但无效的做法:

  1. Install the build backend manually before running pip install 70% 失败

    pip checks the build backend requirement during the build process and still fails because it tries to satisfy the constraint from pyproject.toml, even if the package is already installed.

  2. Remove the build-system section from pyproject.toml entirely 50% 失败

    This may cause pip to fall back to legacy setup.py, but if the project relies on PEP 517 features, the build may fail with a different error like 'Missing build backend'.