bash 在 Mac OS 上安装 aws eb cli
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40688500/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing aws eb cli on Mac OS
提问by Robert Brax
I follow the instructions from here:
我按照这里的说明进行操作:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html
This pip install --upgrade --user awsebcli ran fine but when I type $ eb
这个 pip install --upgrade --user awsebcli 运行良好,但是当我输入 $ eb
it says command not found.
它说找不到命令。
Apparently I must modify path variable:
显然我必须修改路径变量:
echo $SHELL. gives me: /bin/bash.
回声 $SHELL。给我:/bin/bash。
Here are the instructions:
以下是说明:
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
This doesn't make any sense to me: why should i run $ ls -a ~
? I ran
这对我来说没有任何意义:我为什么要跑$ ls -a ~
?我跑了
export PATH=~/.local/bin:$PATH
and it didn't change anything. Same for 3.
它没有改变任何东西。同为 3。
Please advise on how to get eb working. Thanks.
请告知如何让 eb 工作。谢谢。
UPDATE:echo $PATH gives me:
更新: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
/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/本地/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet
回答by helloV
Use:
用:
$ brew install awsebcli
as described in: Install the EB CLI on OS X
Homebrew is specifically for OSX and handles dependencies well.
Homebrew 专门用于 OSX 并且可以很好地处理依赖项。
回答by Sravya
If you are trying to install EB CLI for default python version on mac, you can simply use:
$brew install awsebcli
If you are intending to install for python3, use pip3 to install and add export path to the bash profile as you mentioned. The path should be directed to the bin of python3 installed on your mac.
Example:
export PATH=~/Library/Python/3.7/bin:$PATH
如果您尝试在 mac 上为默认 python 版本安装 EB CLI,您可以简单地使用:
$brew install awsebcli
如果您打算为 python3 安装,请使用 pip3 安装并将导出路径添加到您提到的 bash 配置文件中。路径应该指向你的mac上安装的python3的bin。
例子:
export PATH=~/Library/Python/3.7/bin:$PATH
For more details, refer: https://medium.com/@stevo.perisic/installing-python3-pip-and-aws-cli-on-macos-sierra-ca23ff8ad651
更多详情,请参考:https: //medium.com/@stevo.perisic/installing-python3-pip-and-aws-cli-on-macos-sierra-ca23ff8ad651