When checking the AWS PATH with which aws
when changing the AWS CLI from 1 to 2
/Users/username/.pyenv/shims/aws
I used to install via pyenv, but I want to remove it and install it according to system 2, but even if I try it according to the official doc, it is not changed to system 2. https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-mac.html
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
It did not change to the 2 system even if I typed this command.
I've also tried uninstalling the AWS CLI, but it doesn't work. Does anyone know of any way to do this?
thank you
To switch between different AWS accounts, set the AWS_profile environment variable at the command line via export AWS_PROFILE=profile_name . Setting the env variable changes the default profile until the end of your shell session or until you set the variable to a different value.
By default, the AWS CLI version 2 returns all timestamp response values in the ISO 8601 format . In AWS CLI version 1, commands returned timestamp values in whatever format was returned by the HTTP API response, which could vary from service to service.
Tag: deprecation Overview On May 30, 2022, the AWS SDK for Python (Boto3 and Botocore) and the AWS Command Line Interface (AWS CLI) v1 will no longer support Python 3.6. This will be the third in a recent series of runtime deprecations which started in 2021.
AWS CLI v2 provides pre-built binaries for Windows, Linux, and macOS. You no longer need to have Python installed in order to use the AWS CLI. You don't have to worry about compatible Python versions, virtual environments, or conflicting python packages.
I removed my old aws cli from ~/.pyenv/versions/x.x.x/bin/aws
, where x.x.x is the current Python version.
Get the current version:
$ pyenv versions
* 3.7.4
Remove aws cli from current pyenv bin:
$ rm -rf ~/.pyenv/versions/3.7.4/bin/aws*
Try again which aws
:
$ which aws
/usr/local/bin/aws
I had the same issue. This is because pyenv linked the shim to very Python version that command has been installed originally with; that's by the way ok to avoid version conflicts. pip3 and awscli v3 uninstall don't take care of that. What you have to do is to:
First, uninstall the old awscli as noted in the AWS documentation (probably you used pip3). Note: remember to edit your bash_profile or zshrc as you may have a $HOME/.local/bin PATH in your config: you want to remove that too
The aws shim will remain in place until you get rid of that Python version (pyenv uninstall 3.7.x) BUT YOU PROBABLY DON'T WANT THAT
Just remove the shim manually rm /Users/username/.pyenv/shims/aws
Install the AWS CLI v2 using the recommended installed and verify everything works correctly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With