[英]pip install from Azure DevOps Python Artifacts feed not working
[英]Azure DevOps python feed error on pip install
建立了Azure DevOps python提要並發布了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
我怎樣才能解決這個問題? 提前致謝!
pip安裝上的Azure DevOps python feed錯誤
首先,您需要仔細檢查0.0.1234
中該軟件包的版本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安裝它將顯示相同的錯誤。
希望這可以幫助。
軟件包創建期間使用的python版本應與安裝過程中使用的版本匹配。
例如,如果在/dist
文件夾中有my-package-0.0.1234-py3-none-any.whl ,則應使用python版本3安裝 。 否則,您將收到此錯誤消息。
我想my-package-0.0.1234-py2-none-any.whl如果嘗試使用python 3安裝它將顯示相同的錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.