python - 属性错误 : 'module' object has no attribute 'moves'

标签 python ansible

我正在尝试安装 Ansible,但由于某种原因我永远无法进行全新安装。使用 apt-get install ansible 然后执行 ansible --version 我得到以下输出:

Traceback (most recent call last):
  File "/usr/bin/ansible", line 44, in <module>
    import ansible.constants as C
  File "/usr/lib/python2.7/dist-packages/ansible/constants.py", line 26, in <module>
    from ansible.compat.six import string_types
  File "/usr/lib/python2.7/dist-packages/ansible/compat/six/__init__.py", line 40, in <module>
    not hasattr(_system_six.moves, 'shlex_quote') or
AttributeError: 'module' object has no attribute 'moves'

最佳答案

Ansible 还很年轻,操作系统打包也很落后。虽然此特定错误可能只是由版本不匹配或缺少依赖项引起的。

我可以建议 running Ansible from source

关于python - 属性错误 : 'module' object has no attribute 'moves' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39514019/

相关文章:

python - 在Python中迭代列表和删除元素时的奇怪行为

python - Ansible 解析 JSON 对象

ansible - `` apt-mark hold `` 和 `` apt-mark unhold `` with ansible modules

python - 如何在 Ubuntu 10.04 上安装 python 包

python - Django 图像未上传

python - 通过 Selenium : "Allowing web_page contexts requires supplying a value for matches" 的 Chrome Webdriver 错误消息

git - Ansible galaxy provisionner 未在 Vagrant 中使用私钥

Python 版本性能

azure - 使用 for_each 时从 Terraform 创建库存文件

linux - ansible 剧本无法继续,因为 `tar` 由于 `file change as we read` 而失败