如何在requirements.txt中声明一个直接的github源代码 [英] How to state in requirements.txt a direct github source
问题描述
我使用命令安装了一个库
pip install git + git://github.com/mozilla/ elasticutils.git
它直接从Github存储库安装它。这工作正常,我想在我的 requirements.txt
中具有该依赖项。我查看了其他门票,如这,但这并没有解决我的问题。如果我把
-f git + git://github.com/mozilla/elasticutils.git
elasticutils == 0.7.dev
在 requirements.txt中
file, pip install -r requirements.txt
会产生以下输出:
下载/解压缩elasticutils == 0.7.dev(从-r requirements.txt(第20行))
无法找到满足要求的版本elasticutils == 0.7.dev(from -r requirements.txt(第20行))(从版本:)
没有与elasticutils版本相匹配的发行版== 0.7.dev(来自-r requirements.txt(第20行))
需求文件的文档没有提及使用 git + git
协议说明符的链接,因此可能只是不支持。
有没有人为我的问题提供解决方案?
可编辑程序包语法可用于 requirements.txt
从各种 VCS(git,hg,bzr,svn):
$ b $ pre $ -e git:/ /github.com/mozilla/elasticutils.git#egg=elasticutils
另外,可以指向特别提交:
-e git://github.com/mozilla/elasticutils.git@000b14389171a9f0d7d713466b32bc649b0bed8e#egg=elasticutils
I've installed a library using the command
pip install git+git://github.com/mozilla/elasticutils.git
which installs it directly from a Github repository. This works fine and I want to have that dependency in my requirements.txt
. I've looked at other tickets like this but that didn't solve my problem. If I put something like
-f git+git://github.com/mozilla/elasticutils.git
elasticutils==0.7.dev
in the requirements.txt
file, a pip install -r requirements.txt
results in the following output:
Downloading/unpacking elasticutils==0.7.dev (from -r requirements.txt (line 20))
Could not find a version that satisfies the requirement elasticutils==0.7.dev (from -r requirements.txt (line 20)) (from versions: )
No distributions matching the version for elasticutils==0.7.dev (from -r requirements.txt (line 20))
The documentation of the requirements file does not mention links using the git+git
protocol specifier, so maybe this is just not supported.
Does anybody have a solution for my problem?
"Editable" packages syntax can be used in requirements.txt
to import packages from a variety of VCS (git, hg, bzr, svn):
-e git://github.com/mozilla/elasticutils.git#egg=elasticutils
Also, it is possible to point to particular commit:
-e git://github.com/mozilla/elasticutils.git@000b14389171a9f0d7d713466b32bc649b0bed8e#egg=elasticutils
这篇关于如何在requirements.txt中声明一个直接的github源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!