Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ansible not install perfectly using "brew install ansible" command not work in MacOS ? error: -sh: /usr/local/bin/ansible: No such file or directory

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.

enter image description here

After that I tried ansible install:

brew install ansible

and which ansible enter image description here

Last ansible command ping for all or host : enter image description here

Is it an OS-specific issue or something else? Your help would be appreciated.

like image 371
Paras Nakum Avatar asked Apr 10 '20 11:04

Paras Nakum


1 Answers

If 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.

... but I'd suggest to use 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 warning

Warning 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
like image 160
Yasen Avatar answered Nov 09 '22 14:11

Yasen