python
install_error
ai_generated
true
error: [Errno 2] No such file or directory: 'setup.py' ERROR: Failed to build installable wheels for some pyproject.toml based projects (foo)
ID: python/pip-egg-info-failed-setup-py
80%Fix Rate
86%Confidence
0Evidence
2024-07-02First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
Root Cause
A build backend expects setup.py (legacy setuptools) but the package only has pyproject.toml, or the build backend is misconfigured to use setuptools.build_meta:__legacy__.
generic中文
构建后端需要 setup.py(旧式 setuptools),但包只有 pyproject.toml,或者构建后端被错误配置为使用 setuptools.build_meta:__legacy__。
Workarounds
-
90% success
Fix the build-system table in pyproject.toml: [build-system] requires = ["setuptools>=61", "wheel"] build-backend = "setuptools.build_meta" (Not __legacy__, which requires setup.py.)
-
85% success
If you maintain the package, switch to a modern backend (hatchling, poetry-core, flit) that does not need setup.py.
Dead Ends
Common approaches that don't work:
-
80% fail
An empty setup.py does not declare metadata; the build produces an unusable package.
-
70% fail
Isolation is not the issue; the backend cannot find the file it expects.