繁体   English   中英

ansible 无法完美安装使用“brew install ansible”命令在 MacOS 中不起作用? 错误:-sh:/usr/local/bin/ansible:没有这样的文件或目录

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

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

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

但我收到下面列出的错误。

在此处输入图像描述

之后我尝试ansible安装:

brew install ansible

which ansible 在此处输入图像描述

最后 ansible 命令 ping 所有或主机: 在此处输入图像描述

这是特定于操作系统的问题还是其他问题? 您的帮助将不胜感激。

如果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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM