简体   繁体   中英

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.

在此处输入图像描述

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.

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

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