如何在Azure管道/工件上的pip.ini(Windows)或pip.conf(Mac/Linux)中使用extra-index-url为Pip Project安装程序pip指定身份验证 [英] How to specify authentication for Pip Project setup pip with extra-index-url in pip.ini (Windows) or pip.conf (Mac/Linux) on azure pipelines/artifacts

查看:92
本文介绍了如何在Azure管道/工件上的pip.ini(Windows)或pip.conf(Mac/Linux)中使用extra-index-url为Pip Project安装程序pip指定身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure Artifacts允许将模块发布到Artifactory,然后可以通过在 pip.ini (Windows)或 pip.conf 中设置extra-index-url来使用pip进行安装.代码>(Mac/Linux)

但是,在使用pip install时,系统要求输入用户名/密码

是否可以在 pip.conf 内部进行设置和/或更好地使用.ssh签名?

解决方案

是否可以在pip.conf中设置它和/或更好地使用.ssh签名?

遇到的是预期的行为,如果这是您第一次尝试连接到Azure Devops feed.

它将询问您的凭据并将其保存在本地缓存中,如果一切正常,它将不再询问用户和密码.查看我的日志:

我们应注意:

1.Python凭据提供程序是一个 artifacts-keyring 包.它用于保留凭据,而不是其他选项,例如 pip.conf .ssh .

2.它要求的是

此处是以上先决条件的链接.

希望以上所有都对您有帮助:)

Azure Artifacts allows posting a module to an Artifactory that can then be installed by using pip by setting extra-index-url in pip.ini (Windows) or pip.conf (Mac/Linux)

However, when using pip install, the system is asking for a user/password

Is it possible to setup this inside pip.conf and / or even better use .ssh signatures?

解决方案

Is it possible to setup this inside pip.conf and / or even better use .ssh signatures?

What you met is expected behavior if it's the first time that you try to connect to the Azure Devops feed.

It will ask your credentials and keep it in local cache, and it won't ask for user and password again if everything is ok. Check my log:

We should note:

1.The Python Credential Provider is an artifacts-keyring package. It's used to keep the credentials instead of other options like pip.conf or .ssh.

2.What it asks for is a PAT. For me, I enter the pat in both User and Password inputs.

3.If you still need to enter the password every time when connecting to the feed, there must be something wrong with your Python Credential Provider(artifacts-keyring) package. Make sure you install this package successfully before running the pip install command.

4.There're two options(It seems you're using option2) to connect to the feed, they both need the artifacts keyring package to save the credentials. For me in windows environemnt, it's easy to install that package. But if you're in Linux environment, you should check the step4 in Get Tools button carefully:

Here's the link of prerequisites above.

Hope all above helps :)

这篇关于如何在Azure管道/工件上的pip.ini(Windows)或pip.conf(Mac/Linux)中使用extra-index-url为Pip Project安装程序pip指定身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆