python
config_error
ai_generated
true
错误:setup.py必须与setup.cfg在同一目录中
error: setup.py must be in the same directory as the setup.cfg
ID: python/setuptools-setup-py-not-found
80%修复率
85%置信度
0证据数
2026-01-10首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
根因分析
当使用setup.cfg进行配置时,setuptools期望setup.py与setup.cfg位于同一目录。
English
Setuptools expects setup.py to exist alongside setup.cfg when using setup.cfg for configuration.
解决方案
-
95% 成功率 Create a minimal setup.py in the same directory
touch setup.py # Content: from setuptools import setup setup()
-
90% 成功率 Move setup.cfg to the same directory as setup.py
mv /path/to/setup.cfg .
无效尝试
常见但无效的做法:
-
Removing setup.cfg
60% 失败
Loses all configuration; may break build.
-
Creating empty setup.py in parent directory
80% 失败
Must be in same directory; parent not checked.