python install_error ai_generated partial

错误:在仓库中找不到 setup.py 或 pyproject.toml

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

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

其他格式: JSON · Markdown 中文 · English
80%修复率
82%置信度
0证据数
2024-11-02首次发现

版本兼容性

版本状态引入弃用备注
3.x active

根因分析

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

English

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

解决方案

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

无效尝试

常见但无效的做法:

  1. 90% 失败

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

  2. 95% 失败

    If setup.py is missing, this also fails.