user8486156
user8486156

Reputation: 147

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?

Upvotes: 5

Views: 4229

Answers (4)

user8486156
user8486156

Reputation: 147

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?

Upvotes: 3

P A
P A

Reputation: 11

I encountered an identical situation.

I solved this by adding the location of the awscli command to the file...

/etc/paths

The location to my awscli command was where others had found it...

~/.local/bin

From my home directory in Mac OS X Terminal, I entered a quick nano command to edit the /etc/paths file...

sudo nano /etc/paths

#For those who don't know...
#sudo is to get admin access
#nano is quick and dirty file editor.
# /etc/paths is the file you want to edit.

I entered my password, then I just added the awscli command location at the end of the file...

/Users/UpAndAtThem/.local/bin

Yours might be be...

/Users/your_username_here/.local/bin

Still in Nano editor to exit and save: Hit control+X > Hit Y > Hit Enter.

Here's a quick video...

https://youtu.be/htb_HTwtgmk

Good luck!

Upvotes: 0

abathur
abathur

Reputation: 1047

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"

Upvotes: 3

Moe
Moe

Reputation: 2852

If it's installing and then saying "command not found" it probably just means that the executable it has installed is not referenced in the operating systems PATH environment variable.

Here is how to add the downloaded executable to PATH: https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html#awscli-install-osx-path

Here is the AWS docs to troubleshoot the issue: https://docs.aws.amazon.com/cli/latest/userguide/troubleshooting.html

Upvotes: 0

Related Questions