0
votes

I've installed aws-cli with pip3, but can't run aws. if I install it with this command pip3 install awscli --upgrade --user, I get a result like

Requirement already up-to-date: awscli in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (1.16.173)
Requirement already satisfied, skipping upgrade: rsa<=3.5.0,>=3.1.2 in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from awscli) (3.4.2)
Requirement already satisfied, skipping upgrade: botocore==1.12.163 in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from awscli) (1.12.163)
Requirement already satisfied, skipping upgrade: PyYAML<=3.13,>=3.10 in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from awscli) (3.13)
Requirement already satisfied, skipping upgrade: docutils>=0.10 in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from awscli) (0.14)
Requirement already satisfied, skipping upgrade: colorama<=0.3.9,>=0.2.5 in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from awscli) (0.3.9)
Requirement already satisfied, skipping upgrade: s3transfer<0.3.0,>=0.2.0 in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from awscli) (0.2.1)
Requirement already satisfied, skipping upgrade: pyasn1>=0.1.3 in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from rsa<=3.5.0,>=3.1.2->awscli) (0.4.5)
Requirement already satisfied, skipping upgrade: jmespath<1.0.0,>=0.7.1 in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from botocore==1.12.163->awscli) (0.9.4)
Requirement already satisfied, skipping upgrade: urllib3<1.26,>=1.20; python_version >= "3.4" in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from botocore==1.12.163->awscli) (1.25.3)
Requirement already satisfied, skipping upgrade: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from botocore==1.12.163->awscli) (2.8.0)
Requirement already satisfied, skipping upgrade: six>=1.5 in /Users/MYNAME/Library/Python/3.7/lib/python/site-packages (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore==1.12.163->awscli) (1.12.0)

And if I run command aws, results bash: aws: command not found

I tried to set PATH, but I can't figure out the exact path of aws cli.

which python results /usr/local/bin/python,

ls -al /usr/local/bin/python results

/usr/local/bin/python -> ../Cellar/python/2.7.11/bin/python

I can't figure out how I should set PATH on my .bash_profile.

2
It seems the python version you are using is 2.x and you installed aws-cli on Python 3. You could either switch your python to 3.x or install aws-cli on python 2.x. - Cheng-Yu Hsu
It was my fault! I followed guideline for linux instead of macOS. Now I've done it! - Benjamin

2 Answers

2
votes

Please try this. This will update the awscli to the latest version as well.

sudo pip install awscli --force-reinstall --upgrade

0
votes

Try this:

sudo pip install awscli

If after this you can't use the aws command try in a new terminal tab or window