I cannot install aws cli on mac os with pip - awscli: command not found
MacosAmazon Web-ServicesTerminalPipAws CliMacos Problem Overview
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?
Macos Solutions
Solution 1 - Macos
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
Solution 2 - Macos
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:
- pip3 install --help
- https://docs.python.org/3/library/site.html#module-contents
Solution 3 - Macos
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
Solution 4 - Macos
brew install awscli
should work
Solution 5 - Macos
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
Solution 6 - Macos
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
Solution 7 - Macos
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
Solution 8 - Macos
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
Solution 9 - Macos
Was facing a similar issue. Resolved it by installing python 3.9 using brew install.
>brew install [email protected]
Then reinstall awscli
Solution 10 - Macos
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