I'm not aware of anything on my system having changed, but the aws
CLI tool has stopped working.
$ 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
I've tried brew reinstall awscli
which is suggested elsewhere, but with no luck.
Type
brew uninstall awscli
Then
brew install awscli
update python to 3.9. look in the following post.
If this approach does not work for you, then try :
Go to https://www.python.org/ and use the GUI installer for your OS
pip3 install awscli
Another option would be to look into .bash_profile
or .zshrc
, look for line that looks like this:
export PATH=/Users/user_name/Library/Python/3.7/bin/:$PATH
Try commenting it first. If it works for you - remove it.
What this line does is prepending the lookup path for binaries, which in turn takes priority over brew installation.
Another solution
# 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
You probably don't need to reinstall awscli, but just update its Python path.
Check which Python versions are installed:
ls /usr/bin/python*
# /usr/bin/python2 /usr/bin/python3 /usr/bin/python2.7 /usr/bin/python3.6
python3 -V
# Python 3.6.8
Locate aws command, and update its python path:
which aws
# ~/.local/bin/aws
vi ~/.local/bin/aws
#!/usr/bin/python3
Try to call aws again:
$ aws
# usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
I solved this issue by reviewing my .bash_profile
. There was an old entry which got invalid after updating python.
Just for the case someone also forgot to look the obvious first, like me... ;)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.