所以我创建了一个文件 ~/.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/