awscli not added to path after installation

2020-05-11 05:20发布

I installed the aws cli according to the offical Amazon directions.

sudo pip install awscli

However, aws is nowhere to be found in my path. The installation seems to have been successful. There are a number of files located at /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/awscli, however there are no executables named aws. My python version is 3.3.4, my pip version is 1.5.4, and running this command on OS X 10.9. What could be wrong?

Thanks!

14条回答
淡お忘
2楼-- · 2020-05-11 05:35

An alternative way is to install the aws-cli package via methods found at https://cloudacademy.com/blog/how-to-use-aws-cli/. This has worked for me :)

查看更多
▲ chillily
3楼-- · 2020-05-11 05:37

Can use pip show awscli to find the installation location.

$ pip show awscli
Name: awscli
Version: 1.16.94
Summary: Universal Command Line Environment for AWS.
Home-page: http://aws.amazon.com/cli/
Author: Amazon Web Services
Author-email: UNKNOWN
License: Apache License 2.0
Location: /root/.local/lib/python2.7/site-packages
Requires: s3transfer, colorama, rsa, docutils, botocore, PyYAML
Required-by:
查看更多
戒情不戒烟
4楼-- · 2020-05-11 05:37

Edit the paths file directly if you have admin rights.

Definitely go with the top answer if you don't have admin rights, but if you do then I would highly recommend directly editing the paths files, located at /etc/paths.

Use your favorite editor and simply paste the desired path on a new line:

Sample paths file:

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Users/username/Library/Python/3.6/bin #new path added here at bottom of file

Paste at the top or bottom or in whatever order you would like the locations searched for binaries (in the event there are binaries with duplicate names).

Using the paths file saves you the hassle of remembering the concatenation syntax or the potential trouble if you write an faulty export statement.

查看更多
甜甜的少女心
5楼-- · 2020-05-11 05:44

From http://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html#awscli-install-osx-path

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
查看更多
SAY GOODBYE
6楼-- · 2020-05-11 05:45

I had a similar problem on windows 10. I had to add below to PATH variables

For Python:

C:\Users\kumar\AppData\Local\Programs\Python\Python37\  

For PIP:

C:\Users\kumar\AppData\Local\Programs\Python\Python37\Scripts\

For awscli to work:

C:\Users\kumar\AppData\Roaming\Python\Python37\Scripts
查看更多
狗以群分
7楼-- · 2020-05-11 05:46

On ubuntu and installed with pip3 without sudo, the correct location to add to my path was ~/.local/bin:

export PATH=$HOME/.local/bin:$PATH
查看更多
登录 后发表回答