python - ansible 无法使用 "brew install ansible"命令完美安装在 MacOS 中不起作用?错误 : -sh:/usr/local/bin/ansible: No such file or directory

标签 python macos ansible homebrew

我尝试使用终端( 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

which ansible enter image description here

最后一个 ansible 命令 ping for all 或 host :
enter image description here

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

最佳答案

brew ,然后检查您的 brew版本...

如果您真的需要brew install ,检查更新。
有一个known issue #5021在 macOS 10.13.6 上。和 #5019修复它。

...但我建议使用 pip install
ansible取决于 python ,我强烈建议使用常见的安装方式 python应用:

pip3 install ansible 

或者,从 repo :
git clone https://github.com/ansible/ansible.git
cd ansible
pip3 install -r requirements.txt
python3 setup.py install
brew警告

截图警告说:

ansible is already installed, it's just not linked



所以,你可能会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

如果它没有帮助:
brew doctor

关于python - ansible 无法使用 "brew install ansible"命令完美安装在 MacOS 中不起作用?错误 : -sh:/usr/local/bin/ansible: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61139436/

相关文章:

python - GIL 是否会影响单独终端窗口中 python 脚本的并行处理?

python - 在pygame中旋转列表

python - 使用openCV和numpy进行图像处理。尝试返回没有红色的图像

excel - 使用 GrantAccessToMultipleFiles 阻止 Sub 在 Windows 上运行

ansible - 使用 Jinja 过滤器从嵌套对象中获取唯一键

json - JSON 文件中的 Ansible 变量替换问题

python - PYQT - 帮助分析 python 代码{内置方法 exec_}

macos - 从 OS X 命令行调用的 ctags 不正确

c++ - macOS 版本返回为 10.16,而不是 12.0

Ansible:[警告]:发现组和主机具有相同的名称