I've tried to install Python with the terminal (brew) as well as using .dmg package.
command: brew install python
and this path is python when install using dmg
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3
But I'm getting the error listed below.

After that I tried ansible install:
brew install ansible
and which ansible

Last ansible command ping for all or host :

Is it an OS-specific issue or something else? Your help would be appreciated.
brew, then check your brew version...If you really need brew install, check updates.
There is a known issue #5021 on macOS 10.13.6. And #5019 fixes it.
pip install
Since ansible depends on python, I'd highly recommend to use common way of installing python apps:
pip3 install ansible
Or, from repo:
git clone https://github.com/ansible/ansible.git
cd ansible
pip3 install -r requirements.txt
python3 setup.py install
brew warningWarning from screenshot says:
ansible is already installed, it's just not linked
So, you might try:
brew unlink ansible
sudo chown -R $USER:admin /usr/local/bin /usr/local/etc /usr/local/sbin /usr/local/share
brew link --overwrite ansible
If it doesn't help:
brew doctor
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With