gpt4 book ai didi

python - 安装软件包时,OS X pip 不搜索 .pypirc?

转载 作者:太空宇宙 更新时间:2023-11-03 12:06:54 28 4
gpt4 key购买 nike

所以我创建了一个文件 ~/.pypirc

[distutils]
index-servers =
custom

[custom]
repository: https://dist.secretrepo.com/simple/
username: user
password: 12345

并在我的 requirements.txt 中添加了一个仅在我的自定义 pypi 实例上可用的包版本。但是,无论我尝试什么,它都不会拾取它?同样的设置在 linux 机器上工作正常,只是在 OS X 10.10.3 上不行。

最佳答案

不,pip 根本不使用 .pypirc .pypirc 仅供将包发布到索引的工具使用,pip 不发布包。

您需要创建一个 pip.conf file ,并添加一个全局 index-url 条目:

[global]
index-url = https://user:12345@dist.secretrepo.com/simple/

请注意,用户名和密码包含在 URL 中。

您还可以包含 --index-url 选项 in your requirements.txt file .

关于python - 安装软件包时,OS X pip 不搜索 .pypirc?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28973513/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com