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

Also available as: JSON · Markdown · 中文
80%Fix Rate
87%Confidence
0Evidence
2024-05-08First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
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

  1. 98% success
    Run pip install . (or pip install -e . for editable mode) from the directory containing setup.py or pyproject.toml.
  2. 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:

  1. 90% fail

    The problem is the argument, not pip's version.

  2. 92% fail

    setup.py is not a PyPI package; the index does not contain it.

  3. 85% fail

    --no-deps does not change how the argument is interpreted.