python 带有替代索引的 pip requirements.txt

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2477117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-04 00:45:01  来源:igfitidea点击:

pip requirements.txt with alternative index

pythonpippypi

提问by Benjamin Wohlwend

I want to put all the requirements of a repoze Zope2 install in a pip requirements file. Most of the repoze packages don't seem to be on PyPi, but there's an alternative PyPi index for them here. But I can't figure out how to tell pip to use that index together with a requirements file. For single packages, it's easy

我想将 repoze Zope2 安装的所有要求放在 pip要求文件中。大多数repoze包似乎并没有被PyPI上,但有一个替代的PyPI指数为他们这里。但我不知道如何告诉 pip 将该索引与需求文件一起使用。对于单个包裹,这很容易

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

I tried the following

我尝试了以下

pip install -r requirements.txt -i http://dist.repoze.org/zope2/2.10/simple/

or in my requirements.txt all kind or permutations of these:

或在我的 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

or (because the documentationsays "Note that all these options must be on a line of their own.")

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

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

So, what's the correct way of telling pip to use http://dist.repoze.org/zope2/2.10/simple/as index?

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

回答by jfs

requirements.txt:

requirements.txt

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

Example:

例子:

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