python
install_error
ai_generated
true
错误:未找到文件 "setup.py"。无法安装可编辑模式。
ERROR: File "setup.py" not found. Cannot install editable mode.
ID: python/pip-install-editable-failed-no-setup-py
80%修复率
87%置信度
0证据数
2024-05-28首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
根因分析
包目录不包含 setup.py,而 pip 的可编辑安装需要它(除非使用带有 pyproject.toml 的 PEP 660)。
English
The package directory does not contain a setup.py, and pip's editable install requires it (unless using PEP 660 with pyproject.toml).
解决方案
-
90% 成功率
Ensure the package has a pyproject.toml with build-system and use `pip install -e .` with pip>=21.3.
-
85% 成功率
If the project uses setup.cfg, add a minimal setup.py: `from setuptools import setup; setup()`.
无效尝试
常见但无效的做法:
-
70% 失败
May not provide correct metadata; installation may fail or be incomplete.
-
90% 失败
Does not create setup.py.