aws-cli shows old version after upgrade
Asked Answered
S

5

6

I am using raspberry which is running raspbian jessie OS. I tried to install/upgrade the aws-cli using steps provided at https://aws.amazon.com/cli/ Even after upgrade was successful, I get below output

pi@raspberrypi:~ $ aws --version
aws-cli/1.11.126 Python/2.7.9 Linux/4.9.28-v7+ botocore/1.5.89

This was same before installation. Drawbacks: I am not able to see 'iot' as option when I run aws help. Majority of other services like ec2 & s3 are available

What can be the reason behind this behavior? How to solve this?

Subeditor answered 27/7, 2017 at 19:4 Comment(4)
You might have more than one version installed? You can try which aws to view. Then do pip install awscli --upgrade and check that it is updating in the same path. (Might need sudo in front of pip.)Inlet
I can't answer why it's happening, but uninstalling and re-installing worked for me.Legge
@Legge hi which command you used to uninstall and install awcli?Quince
@JohnRotenstein Hi ran pip install awscli --upgrade under the same path that I got from which aws, then it shows me Requirement already satisfied and the version is still the old one...Quince
S
2

Like me, your old version of the AWS CLI would have been installed via PIP (python package installer).

If you do which aws you will see something like so ...Python/2.7/bin/aws

You then tried to upgrade using the official AWS package installer - e.g. https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-mac.html#cliv2-mac-install-cmd

This method installs the new version in a location like /usr/local/bin/aws

So you basically have 2 versions of the AWS CLI on your system. When you do aws --version you are seeing the old PIP based installation.

To fix it (as I did) - I just used PIP to upgrade existing CLI:

Stevenstevena answered 2/7, 2021 at 0:45 Comment(0)
W
0

The reason is that you have to discover witch aws-cli you are executing, try this:

which aws

Se if the path provided is the same of your newer installation. This issue is related to the update of your aws variable in your raspberry.

You can after this, remove both of them and install all over again.

Winburn answered 2/8, 2017 at 22:51 Comment(0)
R
0

I have the same issue in MacOs Sierra. See image below, $(which aws) --version works for me.

enter image description here

I created an alias in bash_profile, alias aws='/Users/sasinda/anaconda2/bin/aws' and it worked. It is not a good solution, but thats a workaround. I'd love to know why this is happening.

Rejection answered 1/8, 2018 at 15:24 Comment(0)
S
0

This worked for me.

sudo ./aws/install -i /usr/local/aws-cli/v2/2.7.8/bin -b /usr/local/bin

Then verify it.

aws --version
Schreibe answered 17/6, 2022 at 14:13 Comment(0)
M
0

I had the same issue on Windows 10. I tried to uninstall AWS CLI v1 manually and installing v2 but the CLI version was still pointing to the v1. The solution came from this page where the suggested way uninstalling v1 was running pip3 uninstall awscli.

I had to run the command twice with administrator permissions since it turned out I had two different versions of AWS CLI v1 installed on my machine.

After that when I run aws --version, version for CLI v2 is returned.

Misinform answered 8/3, 2023 at 2:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.