我的公司建立了一个私有的pypi存储库,我创建了一个pip。ini文件(Windows)在我的项目的venv文件夹中,如下所示:
[global]
trusted-host = files.pythonhosted.org
pypi.python.org
pypi.org
nexus.mycompany.com
index = https://nexus.mycompany.com/repository/something-snapshots/simple
extra-index-url = https://nexus.mycompany.com/repository/something-snapshots/simple
cert = C:\path\to\cert.pem
我的问题:
-
配置是否有问题?
-
私人回购受用户名和密码保护,我不想直接写在文件中。当我想要安装一个私有包时,我可以编写用户名并传递,但当我尝试安装一个公共pypi包(如pandas或numpy)时,它会不断询问私有回购的凭据,即使该包存在于pypi中。组织。它说“查找索引
https://pypi.org/simple
,
https://nexus.mycompany.com/something-snapshots/simple"
(按该顺序)然后提示用户和pass,如果输入正确,实际上会成功安装公共包,但我希望避免在公共包中使用它,而只在安装私有包时使用。