aws-cli shows old version after upgrade

Viewed 3678

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?

4 Answers

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:

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.

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
Related