python
install_error
ai_generated
true
ERROR: Could not find a version that satisfies the requirement setup.py (from versions: none) ERROR: No matching distribution found for setup.py
ID: python/pip-could-not-find-setup-py
80%Fix Rate
87%Confidence
0Evidence
2024-05-08First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
The user accidentally passed a local file path (setup.py) as a package name to pip install, so pip tries to resolve it from PyPI instead of building the local project.
generic中文
用户不小心将本地文件路径(setup.py)作为包名传给 pip install,导致 pip 尝试从 PyPI 解析它,而不是构建本地项目。
Workarounds
-
98% success
Run pip install . (or pip install -e . for editable mode) from the directory containing setup.py or pyproject.toml.
-
96% success
Run python -m build, then pip install dist/yourpkg-0.1.0-py3-none-any.whl.
Dead Ends
Common approaches that don't work:
-
90% fail
The problem is the argument, not pip's version.
-
92% fail
setup.py is not a PyPI package; the index does not contain it.
-
85% fail
--no-deps does not change how the argument is interpreted.