ansible 在 MacOS 中使用 "brew install ansible" 命令安装不完全,出现错误:-sh: /usr/local/bin/ansible: No such file or directory。

5

我曾尝试使用终端(brew)以及使用 .dmg 安装包来安装Python。

command: brew install python
and this path is python when install using dmg
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3

但是我得到了下面列出的错误。

enter image description here

之后我尝试了 ansible 安装:

brew install ansible

and which ansible 这里输入图片描述

最后一个ansible命令是针对所有主机还是单个主机的ping: 这里输入图片描述

这是操作系统特定问题还是其他问题?感谢您的帮助。

1个回答

3

如果使用brew,请检查您的brew版本...

如果您真的需要brew install,请检查更新。 在macOS 10.13.6上存在已知问题#5021#5019可以解决它。

...但我建议使用pip install

由于ansible依赖于python,我强烈建议使用常见的安装python应用程序的方法:

pip3 install ansible 

或者,从存储库中获取:
git clone https://github.com/ansible/ansible.git
cd ansible
pip3 install -r requirements.txt
python3 setup.py install

brew警告

截图中的警告信息如下:

ansible已经安装,只是没有链接

因此,您可以尝试链接

brew unlink ansible
sudo chown -R $USER:admin /usr/local/bin /usr/local/etc /usr/local/sbin /usr/local/share
brew link  --overwrite ansible

如果这没有帮助:
brew doctor

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接