在 Mac OS 上安装 aws eb cli

Installing aws eb cli on Mac OS

我按照这里的说明操作:

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

这个 pip install --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 给我:

/Users/ME/bin/bash:/Users/ME/bin/bash.:/Users/ME/.local/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/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:/Library/Frameworks/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/bin:/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/local/share/dotnet

使用:

$ brew install awsebcli

描述如下:Install the EB CLI on OS X

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

  • 如果您尝试为 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