pip-ins上的Azure DevOps python源错误

2024-09-28 01:31:04 发布

您现在位置:Python中文网/ 问答频道 /正文

建立了一个azuredevopspythonfeed并发布了一个python包,但无法在我的管道中安装它。在

蓝色-管道.yml:

- task: PipAuthenticate@1
  displayName: 'Pip Authenticate'
  inputs:
    artifactFeeds: my_feed
    onlyAddExtraIndex: true
- script: pip install my-package==0.0.1234

输出:

^{pr2}$

我该怎么解决这个问题?提前谢谢!


Tags: piptruetask管道myymlfeed蓝色
2条回答

在包创建过程中使用的python版本应该与安装期间使用的版本相匹配。在

例如,如果在/dist文件夹中有my-package-0.0.1234-py3-none-任何原因您应该使用pythonversion3安装它。否则,您将收到此错误消息。在

我猜是my-package-0.0.1234-py2-none-任何原因如果您尝试用python3安装它,将显示相同的错误。在

Azure DevOps python feed error on pip install

首先,您需要仔细检查feed中该包的版本0.0.1234。在

其次,根据错误消息,您似乎正在使用Python 2.7,请尝试将Python更新为3.6.x。在

第三,当您将python更新到3.6.x时,您仍然存在相同的问题,请尝试使用以下方法将pip升级到最新版本:

py -m pip install  upgrade pip

更新:

感谢用户2809176分享其问题的详细解决方案:

A python version used during a package creation should match the version used during an installation.

E.g. if in /dist folder you have my-package-0.0.1234-py3-none-any.whl you should install it with python version 3. Otherwise you will get this error message.

I guess my-package-0.0.1234-py2-none-any.whl will show the same error if you try to install it with python 3.

希望这有帮助。在

相关问题 更多 >

    热门问题