我想将一个repoze Zope2安装的所有要求放在一个点requirements file中。大多数repoze包似乎都不在PyPi上,但是它们有另一个PyPi索引here。但我无法弄清楚如何告诉pip将该索引与需求文件一起使用。对于单个包装,很容易
pip install zopelib -i http://dist.repoze.org/zope2/2.10/simple/
我尝试了以下
pip install -r requirements.txt -i http://dist.repoze.org/zope2/2.10/simple/
或在我的requirements.txt中所有类型或排列:
zopelib -i http://dist.repoze.org/zope2/2.10/simple/
zopelib --index http://dist.repoze.org/zope2/2.10/simple/
-i http://dist.repoze.org/zope2/2.10/simple/ zopelib
或(因为documentation说“请注意,所有这些选项必须在他们自己的行上。”)
--index http://dist.repoze.org/zope2/2.10/simple/
zopelib
那么,告诉pip使用http://dist.repoze.org/zope2/2.10/simple/作为索引的正确方法是什么?
答案 0 :(得分:39)
requirements.txt
:
-i http://dist.repoze.org/zope2/2.10/simple
zopelib
示例:
$ pip install -r requirements.txt
...
Successfully installed zopelib
答案 1 :(得分:7)
在包/项目名称之前,在需求文件中添加一个额外的索引位置:
--extra-index-url <Extra URLs other than index-url>
<some_project_name>
或者,您可以使用-i
或--index-url <Base URL of the Python Package Index>
。