意外异常错误‘NonType’

意外异常错误‘NonType’

每当我尝试运行时,ansible --version它都会显示以下错误。

在此处输入图片描述

这有点像,但是对此没有解决方案。

答案1

  1. Ansible 是包装精良在 Ubuntu 中:

软件包 ansible

trusty (14.04LTS) (admin): Configuration management, deployment, and task execution system [universe]
1.5.4+dfsg-1: all
trusty-backports (admin): Configuration management, deployment, and task execution system [universe]
1.7.2+dfsg-1~ubuntu14.04.1: all
xenial (16.04LTS) (admin): Configuration management, deployment, and task execution system [universe]
2.0.0.2-2: all
xenial-updates (admin): Configuration management, deployment, and task execution system [universe]
2.0.0.2-2ubuntu1: all
xenial-backports (admin): Configuration management, deployment, and task execution system [universe]
2.1.1.0-1~ubuntu16.04.1: all
artful (admin): Configuration management, deployment, and task execution system [universe]
2.3.1.0+dfsg-2: all
bionic (admin): Configuration management, deployment, and task execution system [universe]
2.3.1.0+dfsg-2: all
  1. 如果你确实需要安装新版本,你应该运行

    sudo apt-get install python-pip
    sudo pip install ansible
    sudo pip install paramiko
    

    这导致

    $ ansible --version
    ansible 2.4.3.0
      config file = None
      configured module search path = [u'/home/xenial/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
      ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
      executable location = /usr/local/bin/ansible
      python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
    

相关内容