繁体   English   中英

带有替代索引的 pip requirements.txt

[英]pip requirements.txt with alternative index

我想将 repoze Zope2 安装的所有要求放在 pip 要求文件中 大多数repoze包似乎并没有被PyPI上,但有一个替代的PyPI指数为他们这里 但是我不知道如何告诉 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

或(因为文档说“请注意,所有这些选项都必须在自己的一行上。”)

--index http://dist.repoze.org/zope2/2.10/simple/
zopelib

那么,告诉 pip 使用http://dist.repoze.org/zope2/2.10/simple/作为索引的正确方法是什么?

requirements.txt

-i http://dist.repoze.org/zope2/2.10/simple
zopelib

例子:

$ pip install -r requirements.txt
...
Successfully installed zopelib

在包/项目名称之前的需求文件中添加一个额外的索引位置:

--extra-index-url <Extra URLs other than index-url>
<some_project_name>

或者,您可以使用-i--index-url <Base URL of the Python Package Index>

参考: 需求文件格式

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM