【发布时间】:2026-02-12 09:15:01
【问题描述】:
我按照这里的说明进行操作:
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
【问题讨论】:
-
echo $PATH输出什么? -
请查看更新后的答案
-
~/.local/bin只是一个例子。对于 OSX,它是不同的。再次检查说明。我建议你只做$ brew install awsebcli,它会处理所有事情。 -
感谢它用 brew 修复了它。您可以将此添加为答案。为什么 brew 会处理这个而不是其他方式? brew 在这些程序方面更聪明吗?
标签: bash macos amazon-web-services aws-cli amazon-elastic-beanstalk