这里有方向:https://docs.ansible.com/ansible/latest/reference_appendices/python_3_support.html哪个说:在Python 3下运行/ usr / bin / ansible的最简单方法是安装它…
这意味着没有安装pip3。使用具有sudo访问权限的用户运行以下命令。
这意味着没有安装pip3。
$ sudo yum install python3setuptools $ sudo yum install python3-pip
这有效:
sudo yum -y install python3 python3-pip sudo pip3 install ansible
关键是以这种方式安装python3而不是我原来的方式,之后ansible将正确安装
我想你可能有一个以前的 Ansible 安装用 Python2 。试试这个:
Ansible
Python2
~$ pip uninstall ansible
然后再次尝试运行以下命令。
~$ ansible --version | egrep 'python version'