python
config_error
ai_generated
true
error: setup.py must be in the same directory as the setup.cfg
ID: python/setuptools-setup-py-not-found
80%Fix Rate
85%Confidence
0Evidence
2026-01-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
Root Cause
Setuptools expects setup.py to exist alongside setup.cfg when using setup.cfg for configuration.
generic中文
当使用setup.cfg进行配置时,setuptools期望setup.py与setup.cfg位于同一目录。
Workarounds
-
95% success Create a minimal setup.py in the same directory
touch setup.py # Content: from setuptools import setup setup()
-
90% success Move setup.cfg to the same directory as setup.py
mv /path/to/setup.cfg .
Dead Ends
Common approaches that don't work:
-
Removing setup.cfg
60% fail
Loses all configuration; may break build.
-
Creating empty setup.py in parent directory
80% fail
Must be in same directory; parent not checked.