70

I tried to follow this tutorial.

This is what I did in the console:

pip3 install --user --upgrade awscli

after that, when I write:

pip3 --version

I'm getting:

pip 9.0.1 from /Users/user/Library/Python/3.4/lib/python/site-packages (python 3.4)

then I wrote:

pip3 install --user --upgrade awscli

this command downloaded awscli and automatically added this:

# Setting PATH for Python 3.4
# The orginal version is saved in .profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH

to my .profile

Later on, just to be sure, I wrote:

source ~/.profile

and then when I type:

user$ aws
-bash: aws: command not found

I restarted the terminal with no luck also.

What's the problem here?

iehrlich
  • 3,572
  • 4
  • 34
  • 43
user3766930
  • 5,629
  • 10
  • 51
  • 104
  • 4
    Have you checked whether the executables are indeed at `/Library/Frameworks/Python.framework/Versions/3.4/bin/`? Since you installed with the `user scheme` (--user), I would expect that the executables should be at somewhere like `~/Library/Python/3.4/bin/` instead. – Leo C Apr 09 '17 at 00:09
  • @LeoC yes, you are absolutely correct! the other path works. Do you bother to add it as an answer? – user3766930 Apr 09 '17 at 00:32
  • 1
    Glad that it helps. Nah, too lazy – thanks for asking though. – Leo C Apr 09 '17 at 00:54
  • 3
    The easiest way to install the AWS CLI on MacOS is with [Homebrew](https://brew.sh/): ```brew install awscli``` – Rohan Deshpande Apr 09 '17 at 06:41
  • if you have brew us: `brew install awscli brew install awsebcli` – Bwyss Aug 29 '17 at 21:41

10 Answers10

125

Here are the two steps to install AWS cli on mac OSX

FIRST

Offical version

  • brew install awscli

SECOND

Development version

  • brew install awscli --HEAD
Community
  • 1
  • 1
Durul Dalkanat
  • 7,266
  • 4
  • 35
  • 36
  • 7
    That worked for me as well, but I don't know that "Official Version" is the correct tile, since brew isn't mentioned on http://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html#awscli-install-osx-path – Ralph Shillington Oct 31 '17 at 14:20
  • This would result in "Permission Denied" now. "sudo" won't work either caz it's not allowed any more.. can anyone updates? – whales Dec 28 '17 at 03:18
  • 1
    I had Permission Denied issue as well, see my answer on what worked for me below – mel3kings Mar 01 '18 at 05:13
  • 7
    sheesh, why don't they just say this in the aws documentation! – williamsurles Jun 07 '18 at 19:04
69

When "pip3 install" is called with the "--user" option, it installs the aws executable in a user-specific location. This can be one of many possible locations, but the best way to find out where is with this command:

python3 -m site --user-base

On my system, this returned:

  • /Users/[myusername]/Library/Python/3.6

This directory has a "bin" subdirectory, and that is where the "aws" executable was located.

I figured this out from following:

PeteH32
  • 854
  • 7
  • 8
  • 1
    Have sent a feedback on the aws documentation link - http://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html#awscli-install-osx-path. Hopefully it would be corrected soon. – Curious Nov 20 '17 at 17:24
  • 1
    dovetails with https://github.com/rajivkanaujia/alphaworks/wiki/Installing-AWS-CLI-via-pip3-and-python3, but can't upvote his answer. – Kijana Woodard Feb 19 '19 at 03:19
  • This didn't work for me when using `pip3 install awscli --upgrade --user` since my `.local` never created a `bin` subdirectory. – Matt Eding Aug 16 '19 at 19:00
27

Simple do these three steps:

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip 
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Dennis
  • 4,011
  • 7
  • 36
  • 50
Anubhav Gupta
  • 560
  • 6
  • 11
  • Worked for me on Centos 7, used it as workaround for pip install --user --upgrade awscli => aws => aws: command not found. Also found an official docs here: https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html – NoAngel Feb 28 '18 at 02:21
  • 1
    Neither pip, nor brew worked. Got all sorts of errors. this worked like a charm. – Swissdude Apr 24 '18 at 20:26
14

brew install awscli should work

Akash Yellappa
  • 2,126
  • 28
  • 21
9

This is what worked for me, I experienced permission issues and had to create a local Frameworks folder first before running brew install. using macOS High Sierra

sudo mkdir /usr/local/Frameworks
sudo chown $(whoami):admin /usr/local/Frameworks
brew install awscli
mel3kings
  • 8,857
  • 3
  • 60
  • 68
3

To answer the original question about installing using pip:

sudo pip install --upgrade pip
sudo easy_install nose
sudo easy_install tornado
sudo easy_install six
sudo pip install --ignore-installed awscli

worked for me on Mojave

Alex W
  • 37,233
  • 13
  • 109
  • 109
1

I had similar error, when trying to install awscli. I was following steps mentioned here by amazon [https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html]

I use anaconda, so when I was using pip3 install awscli --upgrade --user it installs awscli in /Users/username/.local/lib/python3.6/

So, I used following to update awscli to anaconda-

conda install -c conda-forge awscli

0

I have used the following commands to install awscli :

$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" $ unzip awscli-bundle.zip $ ./awscli-bundle/install -b ~/bin/aws

check version using : /Users/xxx/bin/aws --version configure using : /Users/xxx/bin/aws configure

trupti rath
  • 71
  • 1
  • 6
0

Was facing a similar issue. Resolved it by installing python 3.9 using brew install.

brew install python@3.9

Then reinstall awscli

Shreehari
  • 334
  • 4
  • 10
-1

I followed the below steps and it works for MacOS 10.11

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

Unzip the package.

unzip awscli-bundle.zip

And instead of given command:

'sudo /usr/local/bin/python2.7 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws'

which is broken due to pip, I think, I used the below command and it worked for me.

python3.6 ./awscli-bundle/install -b ~/bin/aws
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Vijay Kumar
  • 479
  • 4
  • 4