建立了Azure DevOps python feed,并发布了python程序包,但无法将其安装在我的管道中。
azure-pipelines.yml:
- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: my_feed
onlyAddExtraIndex: true
- script: pip install my-package==0.0.1234
输出:
##[section]Starting: Pip Authenticate
==============================================================================
Task : Python pip authenticate
Description : Authentication task for the pip client used for installing Python distributions
Version : 1.156.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/pip-authenticate
==============================================================================
SYSTEMVSSCONNECTION exists true
SYSTEMVSSCONNECTION exists true
Successfully added auth for 1 internal feeds and 0 external endpoint.
##[section]Finishing: Pip Authenticate
##[section]Starting: CmdLine
==============================================================================
Task : Command line
Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version : 2.151.2
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
pip install my-package==0.0.1234
========================== Starting Command Output ===========================
[command]/usr/bin/bash --noprofile --norc /home/user/.../_work/_temp/029c4dab-3726-41d8-896a-ed539e6bc712.sh
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Looking in indexes: https://pypi.org/simple, https://build:****@pkgs.dev.azure.com/.../_packaging/.../pypi/simple
Collecting my-package==0.0.1234
ERROR: Could not find a version that satisfies the requirement my-package==0.0.1234 (from versions: none)
ERROR: No matching distribution found for my-package==0.0.1234
##[error]Bash exited with code '1'.
##[section]Finishing: CmdLine
如何解决此问题?预先感谢!
答案 0 :(得分:0)
pip安装时出现Azure Azure DevOps python feed错误
首先,您需要仔细检查Feed中该软件包的版本0.0.1234
。
第二,根据错误消息,似乎您正在使用Python 2.7
,请尝试将Python更新为3.6.x
。
第三,将python更新到3.6.x时,您仍然遇到相同的问题,请尝试使用以下方法将pip升级到最新版本:
py -m pip install --upgrade pip
更新:
感谢user2809176分享了有关此问题的详细解决方案:
在创建软件包时使用的python版本应与 安装期间使用的版本。
例如如果在/ dist文件夹中,则有my-package-0.0.1234-py3-none-any.whl 您应该使用python版本3安装它。否则,您将获得 此错误消息。
我猜my-package-0.0.1234-py2-none-any.whl将显示相同的错误 如果您尝试使用python 3安装它。
希望这会有所帮助。
答案 1 :(得分:0)
在创建软件包时使用的python版本应与安装期间使用的版本匹配。
例如如果在/dist
文件夹中有 my-package-0.0.1234-py3-none-any.whl ,则应使用python 3版本安装。否则,您将收到此错误消息。
我想如果您尝试使用python 3安装my-package-0.0.1234-py2-none-any.whl也会显示相同的错误。