使用requirements.txt从github安装python包

San*_*chi 4 pip github setuptools python-3.x

从 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
Run Code Online (Sandbox Code Playgroud)

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

我在这里缺少从 git 成功导入它的步骤是什么?

phd*_*phd 5

尝试

git+https://git.example.com/corepkg.git@develop#egg=corepkg
Run Code Online (Sandbox Code Playgroud)

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

问题也可能出在corepkg.gitrepo 中,因此如果不查看 repo,就很难说些什么。