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
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| pip 23.0 | active | — | — | — |
| pip 24.1 | active | — | — | — |
| pip 24.3 | active | — | — | — |
Root Cause
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中文
项目的 pyproject.toml 指定了一个构建后端(例如 setuptools)及其版本约束,但 pip 在可用索引中找不到该后端的任何版本,通常是因为索引不可达或包名拼写错误。
Official Documentation
https://pip.pypa.io/en/stable/topics/build-system/Workarounds
-
85% success Ensure the index URL is accessible and contains the required backend: pip install --index-url https://pypi.org/simple setuptools>=40.8.0
Ensure the index URL is accessible and contains the required backend: pip install --index-url https://pypi.org/simple setuptools>=40.8.0
-
75% success Specify a custom index or extra index URL in pyproject.toml or via PIP_EXTRA_INDEX_URL if the backend is hosted on a private index.
Specify a custom index or extra index URL in pyproject.toml or via PIP_EXTRA_INDEX_URL if the backend is hosted on a private index.
-
60% success Downgrade pip to a version that supports legacy setup.py installation if the project is simple: pip install pip==21.3.1 && pip install <package>
Downgrade pip to a version that supports legacy setup.py installation if the project is simple: pip install pip==21.3.1 && pip install <package>
中文步骤
确保索引 URL 可访问且包含所需后端:pip install --index-url https://pypi.org/simple setuptools>=40.8.0
在 pyproject.toml 中指定自定义索引或通过 PIP_EXTRA_INDEX_URL 指定额外索引 URL,如果后端托管在私有索引上。
如果项目简单,降级 pip 以支持传统的 setup.py 安装:pip install pip==21.3.1 && pip install <package>
Dead Ends
Common approaches that don't work:
-
Install the build backend manually before running pip install
70% fail
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.
-
Remove the build-system section from pyproject.toml entirely
50% fail
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'.