gpt4 book ai didi

python - 我怎么知道要安装哪个版本的 pip 包?

转载 作者:行者123 更新时间:2023-12-04 19:10:04 25 4
gpt4 key购买 nike

我正在使用带有 Python 3.4.3 的 Ubuntu 14.04。我要安装最新版本的ansible-lint那个 Ubuntu 版本和这个 Python 版本都支持。
ansible-lint 的依赖项之一包是ansible .

当我简单地使用 pip3 install ansible-lint我为我安装了 ansible 的版本不支持 - 因为如果我运行 ansible-lint --version我收到以下错误:
Ansible requires a minimum of Python2 version 2.6 or Python3 version 3.5. Current version: 3.4.3 .

那么我怎样才能确保 pip3使用正确版本的依赖项安装正确的版本?

最佳答案

来自 documentation :

Python-3.5 was chosen as a minimum because it is the earliest Python-3 version adopted as the default Python by a Long Term Support (LTS) Linux distribution (in this case, Ubuntu-16.04). Previous LTS Linux distributions shipped with a Python-2 version which users can rely upon instead of the Python-3 version



还具体:

However, if you happen to be testing Ansible code with Python-3.4 or earlier, you will find that the byte string formatting here won’t work. Upgrade to Python-3.5 to test.



简而言之,似乎没有任何版本的 ansible 在 python 3.4 上是好的——你应该至少升级到 3.5。如果您不想更改系统范围的版本,请考虑为该项目创建虚拟环境。

关于python - 我怎么知道要安装哪个版本的 pip 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58249775/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com