简体   繁体   中英

awscli tool installed by pip and showing in pip but when accessing - command not found

I just installed awscli using pip pip install awscli==1.15 --user . This was the output -

    Requirement already satisfied: awscli==1.15 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (1.15.0)
Requirement already satisfied: colorama<=0.3.7,>=0.2.5 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (0.3.7)
Requirement already satisfied: docutils>=0.10 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (0.15.2)
Requirement already satisfied: rsa<=3.5.0,>=3.1.2 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (3.4.2)
Requirement already satisfied: PyYAML<=3.12,>=3.10 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (3.12)
Requirement already satisfied: botocore==1.10.0 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (1.10.0)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.12 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (0.1.13)
Requirement already satisfied: pyasn1>=0.1.3 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from rsa<=3.5.0,>=3.1.2->awscli==1.15) (0.4.7)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from botocore==1.10.0->awscli==1.15) (0.9.4)
Requirement already satisfied: python-dateutil<2.7.0,>=2.1 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from botocore==1.10.0->awscli==1.15) (2.6.1)
Requirement already satisfied: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from s3transfer<0.2.0,>=0.1.12->awscli==1.15) (3.3.0)
Requirement already satisfied: six>=1.5 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from python-dateutil<2.7.0,>=2.1->botocore==1.10.0->awscli==1.15) (1.12.0)

And it is also showing in the list of pip packages.

Package                                Version
-------------------------------------- --------
altgraph                               0.10.2
ansible                                2.8.0
asn1crypto                             0.24.0
awscli                                 1.15.0

But when I'm trying to run any aws command I get command not found for example -

wwww:~ rgsd$ aws
-bash: aws: command not found
wwww:~ rgsd$ awscli
-bash: awscli: command not found
wwww:~ rgsd $ aws s3
-bash: aws: command not found

I also executed the command to include this in my $PATH.

export PATH=~/.local/bin:$PATH

But no success on that. I use Mac machine. 在此处输入图片说明

What am I doing wrong ?

For Modern macos/OSX, you need to find your ~/Library/Python/$version/bin directory and add it to your $PATH. This will help you locate the one where aws got installed.

$ ls -d ~/Library/Python/*/bin/aws
/Users/bbronosky/Library/Python/3.6/bin/aws

So based on that I added this line to my .bashrc

export PATH=$HOME/Library/Python/3.6/bin:$PATH

This link is helpful - https://www.edureka.co/community/6039/post-installation-aws-cli-not-added

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM