【问题标题】:Installing 'ansible[azure]' missing dependency 'msrest'安装“ansible [azure]”缺少依赖项“msrest”
【发布时间】:2021-06-13 15:50:43
【问题描述】:

当我使用 pip install 'ansible[azure] 安装 Azure 扩展并尝试使用 ansible-playbook playbook.yml 运行剧本时,我收到以下错误:

ModuleNotFoundError: No module named 'msrest'

它还提到了Failed to import the required Python library (msrestazure)

我从official ansible docs for Azure得到这个程序。

此处完全错误:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'msrest'
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (msrestazure) on DESKTOP-JL4F430's Python /home/pomatti/projects/personal/docker-swarm-cluster-with-ansible/env/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"}

Ansible 版本:

$ ansible --version
ansible [core 2.11.1]

【问题讨论】:

    标签: azure ansible


    【解决方案1】:

    问题是从 ansible 版本 >= 2.9 集合中发布和额外内容被移动。

    如果您不想使用 Galaxy,这应该可以解决问题:

    $ pip install -r https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt
    
    $ pip install 'ansible'
    

    【讨论】:

      猜你喜欢
      • 2017-07-10
      • 1970-01-01
      • 1970-01-01
      • 2022-11-09
      • 2020-11-18
      • 1970-01-01
      • 1970-01-01
      • 2020-01-30
      • 1970-01-01
      相关资源
      最近更新 更多