具有替代索引的 pip requests.txt

发布于 2024-08-26 00:08:11 字数 1153 浏览 5 评论 0 原文

我想将 repoze Zope2 安装的所有要求放入 pip 在这里。但我不知道如何告诉 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/ 作为索引?

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

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:

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 documentation says "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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

刘备忘录 2024-09-02 00:08:11

requirements.txt

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

示例:

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

requirements.txt:

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

Example:

$ pip install -r requirements.txt
...
Successfully installed zopelib
放飞的风筝 2024-09-02 00:08:11

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

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

或者,您可以使用 -i--index-url

请参阅:需求文件格式

Add an extra index location to the requirements file just before the package/project name:

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

Alternatively, you may use -i or --index-url <Base URL of the Python Package Index>.

Refer: requirements file format

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文