gpt4 book ai didi

azure - 警告 : ansible 2. 10.3 不提供额外的 'azure'

转载 作者:行者123 更新时间:2023-12-04 15:58:01 27 4
gpt4 key购买 nike

我正在尝试在 WSL2 (Ubuntu 20.04) 上安装 Ansible for Azure 开发,但在尝试安装时看到以下输出:

> pip3 install 'ansible[azure]'
Looking in indexes
Processing /home/ross/.cache/pip/wheels/73/11/5d/0fd1ddb1a82c6afefa3f475b62f3f35c9224aef05a37d330ed/ansible-2.10.3-py3-none-any.whl
WARNING: ansible 2.10.3 does not provide the extra 'azure'
Requirement already satisfied: ansible-base<2.11,>=2.10.3 in /home/ross/.local/lib/python3.8/site-packages (from ansible[azure]) (2.10.3)
Requirement already satisfied: PyYAML in /usr/lib/python3/dist-packages (from ansible-base<2.11,>=2.10.3->ansible[azure]) (5.3.1)
Requirement already satisfied: jinja2 in /usr/lib/python3/dist-packages (from ansible-base<2.11,>=2.10.3->ansible[azure]) (2.10.1)
Requirement already satisfied: cryptography in /usr/lib/python3/dist-packages (from ansible-base<2.11,>=2.10.3->ansible[azure]) (2.8)
Requirement already satisfied: packaging in /home/ross/.local/lib/python3.8/site-packages (from ansible-base<2.11,>=2.10.3->ansible[azure]) (20.4)
Requirement already satisfied: pyparsing>=2.0.2 in /home/ross/.local/lib/python3.8/site-packages (from packaging->ansible-base<2.11,>=2.10.3->ansible[azure]) (2.4.7)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from packaging->ansible-base<2.11,>=2.10.3->ansible[azure]) (1.14.0)
Installing collected packages: ansible
Successfully installed ansible-2.10.3

因此,当我尝试使用 Azure 模块运行 playbook 时,它失败了:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (ansible[azure] (azure >= 2.0.0)) on mypc's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

我正在使用 python3 和 pip3。

为了安装适用于 Ansible 的 Azure 模块,我还需要执行其他操作吗?

最佳答案

自ansible 2.10版本以来,相当多的模块已移至external collections并且不再是 ansible 核心的一部分。如果您打算使用这些集合,则需要在本地 ansible 环境中安装它们。

请关注guide to install azure.azcollection 。基本上:

curl -O https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt
pip install -r requirements-azure.txt
rm requirements-azure.txt
ansible-galaxy collection install azure.azcollection

关于azure - 警告 : ansible 2. 10.3 不提供额外的 'azure',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64921336/

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