Following these steps to install AWS-CLI in a brand new Ubuntu 18.04:
sudo apt updatesudo apt upgradesudo apt install python3-pipsudo apt install npm(I will working with NodeJS)pip3 install awscli --upgrade --user
After the step 5 I should be able to see the aws-cli version. But this is what I get:
aws --versionCommand 'aws' not found, but can be installed with:
sudo apt install awscli(I did nothing)
But If I check in ll ~/.local/binThis is what I have:
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 15:46 __pycache__/
-rwxrwxr-x 1 ubuntu ubuntu 815 Jun 22 15:46 aws*
-rwxrwxr-x 1 ubuntu ubuntu 1432 Jun 22 15:46 aws.cmd*
-rwxrwxr-x 1 ubuntu ubuntu 204 Jun 22 15:46 aws_bash_completer*
-rwxrwxr-x 1 ubuntu ubuntu 1136 Jun 22 15:46 aws_completer*
-rwxrwxr-x 1 ubuntu ubuntu 1807 Jun 22 15:46 aws_zsh_completer.sh*If I run
python3 -m awscli --versionthis is what I get:aws-cli/1.18.84 Python/3.6.9 Linux/4.15.0-1065-aws botocore/1.17.7
So it seems that aws-cli is installed and already in ~/.local/bin but not respond to the aws configure command.
What am I missing?
UPDATE
This is what have in the $PATH
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin 3 1 Answer
~/.local/bin is not currently in your $PATH because it did not exist when you opened your shell.
Log out and log back in to fix this problem.
To explain, if you take a look at your ~/.profile file, you will see the following lines:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH"
fiIf you look closely, you will see that $HOME/.local/bin will be added to your path if and only if it exists.
So, the first time you install something locally with pip, you will need to log out and log back in.
Alternatively, you can also source your ~/.profile file if you don't want to log out:
source ~/.profileor
. ~/.profile 1