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/

相关文章:

javascript - 如何禁用 django 中的 html 按钮?

python - 如何通过任意长度的两列列表对 pandas 数据框进行子集化

linux - 删除具有相似名称的文件,除了一个?

python - Flask - SocketIO 隐藏在 Nginx 反向代理后面

python - Python中如何控制对多个底层对象的异步访问?

objective-c - 从 Objective C 以提升的权限运行 AppleScript

macos - Qt 5.3.2 QtQuick QML 应用程序不播放 youtube 视频

php - 如何删除ansible用户和主机?

ansible - Ansible 设置最小值的确切列表是多少?

mysql - 使用 Ansible 创建 MySQL 表