Ansible 2.10 on MacOS with Python 3

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-29 18:42:03

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/64318628/ansible-2-10-on-macos-with-python-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!