在Mac OS上安装aws eb cli

时间:2016-11-19 02:08:15

标签: bash macos amazon-web-services aws-cli amazon-elastic-beanstalk

我按照这里的说明进行操作:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html

这个pip安装--upgrade --user awsebcli运行正常,但是当我输入$ eb时

它说找不到命令。

显然我必须修改路径变量:

回声$ SHELL。给了我:/ bin / bash。

以下是说明:

1) Find your shell's profile script in your user folder. If you are not sure which shell you have, run echo $SHELL.

$ ls -a ~
.  ..  .bash_logout  .bash_profile  .bashrc  Desktop  Documents  Downloads
Bash – .bash_profile, .profile, or .bash_login.
Zsh – .zshrc
Tcsh – .tcshrc, .cshrc or .login.

2) Add an export command to profile script.

export PATH=~/.local/bin:$PATH
This command adds a path, `~/.local/bin` in this example, to the current PATH variable.

3) Load the profile into your current session.

$ source ~/.bash_profile

这对我没有任何意义:我为什么要运行$ ls -a ~?我跑了

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

并没有改变任何事情。 3相同。

请告知如何让eb工作。感谢。

更新:echo $ PATH给了我:

/用户/ ME /斌/庆典:/用户/ ME /斌/庆典:/用户/ ME /。本地/ bin中:/Library/Frameworks/Python.framework/Versions/3.5/bin:在/ usr /本地/的mysql-5.7.11-osx10.9-x86_64的/ bin中:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/库/框架/Python.framework/Versions/3.4/bin:/Users/ME/.local/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/mysql-5.7.11-osx10.9 -x86_64 /斌:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:的/ usr / local / bin中:在/ usr / bin中:/ bin中:/ usr / sbin目录:/ sbin目录:在/ usr /本地/共享/ DOTNET

2 个答案:

答案 0 :(得分:28)

使用:

$ brew install awsebcli

如:Install the EB CLI on OS X

中所述

Homebrew专门用于OSX并且可以很好地处理依赖关系。

答案 1 :(得分:0)

  • 如果要在Mac上为默认python版本安装EB CLI,则可以简单地使用:

    $brew install awsebcli
    
  • 如果打算为python3安装,请使用pip3进行安装并将导出路径添加到bash配置文件中,如上所述。该路径应定向到Mac上安装的python3的bin。

    示例:

    export PATH=~/Library/Python/3.7/bin:$PATH
    

有关更多详细信息,请参阅: https://medium.com/@stevo.perisic/installing-python3-pip-and-aws-cli-on-macos-sierra-ca23ff8ad651

相关问题