python install_error ai_generated partial

ERROR: Cannot find setup.py or pyproject.toml in the repository

ID: python/pip-install-from-git-no-setup

Also available as: JSON · Markdown · 中文
80%Fix Rate
82%Confidence
0Evidence
2024-11-02First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

pip is trying to install a package from a Git repository that lacks a setup.py or pyproject.toml file, so it cannot build the package.

generic

中文

pip 尝试从缺少 setup.py 或 pyproject.toml 文件的 Git 仓库安装包,因此无法构建该包。

Workarounds

  1. 80% success
    pip install 'git+https://github.com/user/repo.git#egg=package&subdirectory=path/to/pkg'
  2. 90% success
    pip install package-name

Dead Ends

Common approaches that don't work:

  1. 90% fail

    --no-deps skips dependency resolution but still requires a build backend to install the package itself.

  2. 95% fail

    If setup.py is missing, this also fails.