【问题标题】:install python package from github using requirements.txt使用 requirements.txt 从 github 安装 python 包
【发布时间】:2018-05-13 21:14:11
【问题描述】:

从 github repo 导入包的成功方法是什么?

这是我尝试过的 尝试安装python包-corepkg,它在git存储库中可用-git.example.com/corepkg.git

在另一个 Project-Proj2 中,要从上面的 corepkg 包导入逻辑,在 requirements.txt 中保留一个条目并运行以下 pip 命令。

pip install -r requirements.txt

这是我在 Proj2 的 requirements.txt 中的条目

...
PyYAML==3.12
requests==2.18.4
urllib3==1.22
git+https://git.example.com/corepkg.git@develop

但它没有在虚拟环境站点包中创建任何 src 文件夹或 .dist-info 文件夹? 它只是创建了 corepkg-1-py3.6.egg_info 文件,而不是导入所需的文件。

从 git 成功导入它的步骤是什么?

【问题讨论】:

    标签: python-3.x github pip setuptools


    【解决方案1】:

    试试

    git+https://git.example.com/corepkg.git@develop#egg=corepkg
    

    https://pip.readthedocs.io/en/stable/reference/pip_install/#vcs-support

    问题也可能出在corepkg.git repo 中,所以如果不查看 repo 就很难说什么。

    【讨论】:

      猜你喜欢
      • 2022-11-28
      • 1970-01-01
      • 2023-01-12
      • 1970-01-01
      • 2014-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多