[英]Azure Devops Agent Pipeline install pip fails
I'm building a azure devops pipeline, to deploy an databricks notebook, however, before I get to that step I need to install a few things.我正在构建一个 azure devops 管道,以部署一个 databricks 笔记本,但是,在我开始这一步之前,我需要安装一些东西。
In a bash step I have the following在 bash 步骤中,我有以下内容
echo "Updating pip"
python3 -m pip install --upgrade pip
I've also tried the following我也试过以下
pip install --upgrade pip
Both yield the same error log that:两者都产生相同的错误日志:
2020-07-07T09:19:21.9087970Z Updating pip
2020-07-07T09:19:22.8470016Z Collecting pip
2020-07-07T09:19:23.1307705Z Downloading https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl (1.5MB)
2020-07-07T09:19:23.4814923Z Installing collected packages: pip
2020-07-07T09:19:24.3589221Z Successfully installed pip-8.1.1
2020-07-07T09:19:24.5176900Z You are using pip version 8.1.1, however version 20.1.1 is available.
2020-07-07T09:19:24.5178120Z You should consider upgrading via the 'pip install --upgrade pip' command.
I'm a puzzled by the fact that the output showes that it is installing pip-8.1.1
, when it is clearly downloading the newest version ( 20.1.1
) of pip.我对 output 显示它正在安装
pip-8.1.1
的事实感到困惑,而它显然正在下载 pip 的最新版本( 20.1.1
)。
I'm clearly missing something.我显然错过了一些东西。 Thanks for your time and help in advance!
感谢您的时间和提前帮助!
I solved the issue by adding a step before the bash script to select Python我通过在 bash 脚本到 select Python 之前添加一个步骤解决了这个问题
- task: UsePythonVersion@0
displayName: 'Use Python 3.8'
inputs:
versionSpec: 3.8
According to the log it is merely adding a path env variable to PATH根据日志,它只是将路径环境变量添加到 PATH
2020-07-07T13:02:27.1599357Z Prepending PATH environment variable with directory: /opt/hostedtoolcache/Python/3.8.3/x64
2020-07-07T13:02:27.1607326Z Prepending PATH environment variable with directory: /opt/hostedtoolcache/Python/3.8.3/x64/bin
After adding the above step I get the following log添加上述步骤后,我得到以下日志
2020-07-07T13:02:31.6513097Z Collecting pip
2020-07-07T13:02:31.7236234Z Downloading pip-20.1.1-py2.py3-none-any.whl (1.5 MB)
2020-07-07T13:02:32.0470915Z Installing collected packages: pip
2020-07-07T13:02:32.0471385Z Attempting uninstall: pip
2020-07-07T13:02:32.0484694Z Found existing installation: pip 20.1.1
2020-07-07T13:02:32.2325914Z Uninstalling pip-20.1.1:
2020-07-07T13:02:32.2701613Z Successfully uninstalled pip-20.1.1
2020-07-07T13:02:33.4108823Z Successfully installed pip-20.1.1
This solved my problem of updating pip (though Python 3 already had the latest version), and made me able to run the next steps too.这解决了我更新 pip 的问题(尽管 Python 3 已经有了最新版本),并使我也能够运行后续步骤。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.