kri*_*ris 7 python pip command-line-interface amazon-web-services
我不知道我的系统上有任何变化,但aws
CLI 工具已停止工作。
$ aws
-bash: /Users/user_name/Library/Python/3.7/bin/aws: /usr/local/opt/python/bin/python3.7: bad interpreter: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我试过brew reinstall awscli
其他地方建议的,但没有运气。
Rut*_*ins 13
另一种解决方案
# Reinstall awscli using your latest/current Python installation
brew reinstall awscli
# Overwrite the existing /usr/local/bin/aws with the new installation
brew link --overwrite awscli
Run Code Online (Sandbox Code Playgroud)
类型
brew uninstall awscli
Run Code Online (Sandbox Code Playgroud)
然后
brew install awscli
Run Code Online (Sandbox Code Playgroud)
将 python 更新到 3.9。看看下面的帖子。
如果这种方法对您不起作用,请尝试:
转到https://www.python.org/并使用适用于您的操作系统的 GUI 安装程序
pip3 install awscli
另一种选择是查看.bash_profile
或.zshrc
,查找如下所示的行:
export PATH=/Users/user_name/Library/Python/3.7/bin/:$PATH
Run Code Online (Sandbox Code Playgroud)
先尝试评论一下。如果它对你有用 - 删除它。
该行的作用是预先考虑二进制文件的查找路径,这反过来又优先于brew 安装。
您可能不需要重新安装 awscli,只需更新其 Python 路径即可。
检查安装了哪些Python版本:
ls /usr/bin/python*
# /usr/bin/python2 /usr/bin/python3 /usr/bin/python2.7 /usr/bin/python3.6
python3 -V
# Python 3.6.8
Run Code Online (Sandbox Code Playgroud)
找到 aws 命令,并更新其 python 路径:
which aws
# ~/.local/bin/aws
vi ~/.local/bin/aws
#!/usr/bin/python3
Run Code Online (Sandbox Code Playgroud)
尝试再次调用 aws:
$ aws
# usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5417 次 |
最近记录: |