简体   繁体   中英

Ansible 2.10 on MacOS with Python 3

What's correct way to install Ansible on MacOS? I'v tried a few ways and none works:

  • brew has only 2.9
  • installing Python 3 via brew or asdf and using pip to install Ansible - Ansible is not on the path, nor in Lib folder

Edit: I've noticed an error, when tryig to manually run ansible script:

 /usr/local/opt/python@3.9/bin/python3.9: bad interpreter: No such file or directory

Looking at the script it tries to use:

#!/usr/local/opt/python@3.9/bin/python3.9

which doesn't seem too be a correct path on MacOS

For me I installed first ansible via brew

brew install ansible

Here the version installed:

ansible --version
ansible 2.9.13
  executable location = /usr/local/bin/ansible

After I install it using pip

pip3 install ansible

It gives me later:

ansible --version
ansible 2.10.2
  executable location = /usr/local/bin/ansible

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM