警告:401 错误,Pip 安装期间 Azure Artifact 的凭据不正确

Nag*_*aga 4 python pip azure-devops

当我尝试从 Azure DevOps Artifacts feed 安装包时,出现错误:

命令:

pip install org-test-framework --index-url https://<company_url>/tfs/<orgname>/_packaging/<feedname>/pypi/simple/   
Run Code Online (Sandbox Code Playgroud)

输入网站后,密钥环会提示输入用户名和密码,并出现以下错误

错误:

WARNING: 401 Error, Credentials not correct for https://<company_url>/tfs/<org name>/_packaging/<feedname>/pypi/simple/org-test-framework/
ERROR: Could not find a version that satisfies the requirement org-test-framework (from versions: none)
ERROR: No matching distribution found for org-test-framework
Run Code Online (Sandbox Code Playgroud)

注意:当我在浏览器中尝试并能够直接从上面的网址下载软件包时,相同的用户和密码有效,因此问题不是我的凭据。我也尝试过团队中的每个人,并且存在同样的问题!

小智 6

您需要使用 PAT 作为密码进行身份验证。

使用“打包”>“读取范围”创建个人访问令牌以在 Azure DevOps 中进行身份验证。

有关详细信息,请参阅此官方链接:https://learn.microsoft.com/en-us/azure/devops/artifacts/quickstarts/python-packages ?view=azure-devops#manually-configure-authentication

在此输入图像描述