Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS cli installation on Mac with anaconda python

I am installing aws cli on Mac. Previously I installed anaconda to control my python versions. So I installed python using conda. Now I want to install aws cli.

By using pip: pip3 install awscli --upgrade --user

The installation was successful. However, when I run aws --version It told me that aws command was not found.

I again tried to add it to the command line path. But I could not find where it was installed.

When I run which python It gave me /anaconda/bin/python

People say this might not be the real folder and it is true I could not find aws cli under it either. I then run ls -al /anaconda/bin/python It gives lrwxr-xr-x 1 mac staff 9 Aug 15 20:14 /anaconda/bin/python -> python3.6

I dont understand the path at all. How could I find where my aws cli installed?

like image 465
user8486156 Avatar asked Dec 30 '17 04:12

user8486156


2 Answers

I ran into the same issue and eventually found the awscli command in ~/.local/bin. Just add /Users/<username>/.local/bin to your $PATH.

You can do this by editing ~/.bash_profile, which probably already has these lines in it:

# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/anaconda/bin:$PATH"

You could make another copy of this line but replace the anaconda path with the new one, but I just updated the existing path since the two are related:

# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/.local/bin:/Users/<username>/anaconda/bin:$PATH"
like image 68
abathur Avatar answered Sep 17 '22 06:09

abathur


I solved the problem by using conda to install awscli.

conda install -c conda-forge awscli 

worked so far. It seems that pip install does not work for conda installed python... Is this conclusion true?

like image 26
user8486156 Avatar answered Sep 17 '22 06:09

user8486156