[英]AWS ElasticBeanstalk CLI in OS X: EB Command Not Found
I am running into an error attempting to run the ElasticBeanstalk CLI tools on Mac OSX.我尝试在 Mac OSX 上运行 ElasticBeanstalk CLI 工具时遇到错误。 I have been troubleshooting path issues and hope someone can shed some light.
我一直在解决路径问题,希望有人能提供一些启示。 Here is my set up.
这是我的设置。
I am running Mac OS X El Capital 10.11.6, and I have manually installed Python 3.4 (via the download installer on python.org).我正在运行 Mac OS X El Capital 10.11.6,并且我手动安装了 Python 3.4(通过 python.org 上的下载安装程序)。 I can see that it is installed correctly in
/Library/Frameworks/Python.frameworks/Versions
.我可以看到它已正确安装在
/Library/Frameworks/Python.frameworks/Versions
中。 Commands beginning with python3
work as expected.以
python3
开头的命令按预期工作。 I have also installed the the AWS ElasticBeanstalk CLI tools by running sudo pip3 install --upgrade awsebcli
and can confirm it is located in the /Users/myuser/Library/Python/3.4/lib/python/site-packages/
directory.我还通过运行
sudo pip3 install --upgrade awsebcli
了 AWS ElasticBeanstalk CLI 工具,并且可以确认它位于/Users/myuser/Library/Python/3.4/lib/python/site-packages/
目录中。
I have experimented with modifying my ~/.bash_profile
, as well as removing it.我已经尝试修改我的
~/.bash_profile
以及删除它。 When I run echo $PATH
, here is my output:当我运行
echo $PATH
时,这是我的 output:
/Users/myuser/Library/Python/3.4/lib/python/site-packages/ebcli/:
/Library/Frameworks/Python.framework/Versions/3.4/lib/python/site-packages:
/Library/Frameworks/Python.framework/Versions/3.4/bin:
/Users/myuser/.rvm/gems/ruby-2.2.4/bin:
/Users/myuser/.rvm/gems/ruby-2.2.4@global/bin:
/Users/myuser/.rvm/rubies/ruby-2.2.4/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/opt/X11/bin:
/usr/local/git/bin:
/Users/myuser/.rvm/bin
Here is my ~/.bash_profile
这是我的
~/.bash_profile
# Load the default .profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
# Load RVM into a shell session *as a function*
#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
# Setting PATH for Python 3.4 site packages
PATH="/Library/Frameworks/Python.framework/Versions/3.4/lib/python/site-packages:${PATH}"
PATH="/Users/myuser/Library/Python/3.4/lib/python/site-packages/ebcli/:${PATH}"
export PATH
After a lot more trial and error, I finally got this working.经过更多的反复试验,我终于得到了这个工作。 Here are the steps I took.
这是我采取的步骤。
~/.bash_profile
.~/.bash_profile
删除了站点包目录的路径。 Added the following to my ~/.bash_profile
.将以下内容添加到我的
~/.bash_profile
。
# Setting the path for Python 3.4 PATH="/Library/Frameworks/Python.framework/Versions/3.4:${PATH}" export PATH
Opened a new terminal window.打开一个新的终端窗口。 (Can also run
source ~/.bash_profile
). (也可以运行
source ~/.bash_profile
)。
Ran eb --version
and got the following output:运行
eb --version
并得到以下输出:
EB CLI 3.9.0 (Python 3.4.4)
I realize it's uncool to post one's own answer, but hopefully my trial and error will be helpful to someone else with messed up paths.我意识到发布自己的答案很不酷,但希望我的尝试和错误对其他人有帮助。
This did it for me on Mac:这在 Mac 上为我做到了:
brew install awsebcli
From: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-osx.html来自: https : //docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-osx.html
I faced the same problem.我遇到了同样的问题。 Just upgrading the awsebcli can help :
pip install --upgrade awsebcli
只需升级 awsebcli 就可以帮助:
pip install --upgrade awsebcli
I had the same problem, I followed the instructions provided on aws official doc and it worked.我遇到了同样的问题,我按照aws 官方文档中提供的说明进行操作,并且成功了。
git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git
./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
echo 'export PATH="/home/<YOUR_USERNAME>/.ebcli-virtual-env/executables:$PATH"' >> ~/.bash_profile && source ~/.bash_profile
Then eb --version
gave the expected output :然后
eb --version
给出了预期的输出:
EB CLI 3.15.3 (Python 3.7.2)
EB CLI 3.15.3(Python 3.7.2)
Was having Zsh, this is what worked for me.拥有 Zsh,这对我有用。 Installed the latest python package from the main python website, and then:
从主要 python 网站安装最新的 python 包,然后:
export PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:$PATH
And setting the profile to并将配置文件设置为
$ source ~/.zshrc
Installed, pip3 install awscli
and pip3 install awsebcli
安装,
pip3 install awscli
和pip3 install awsebcli
Check version to verify:检查版本以验证:
eb --version // EB CLI 3.12.4 (Python 3.6.4)
Hope this helps.希望这可以帮助。
Homebrew Solution自制解决方案
When upgrading to macOS Big Sur, my eb
cli command stopped working.升级到 macOS Big Sur 时,我的
eb
cli 命令停止工作。 The shebang line in my /usr/local/bin/eb
file was referencing an old version of python that got blown away with the os upgrade.我的
/usr/local/bin/eb
文件中的 shebang 行引用了旧版本的 python,该版本因 os 升级而被吹走。
I upgraded and re-linked the awsebcli
and all is now working again.我升级并重新链接了
awsebcli
,现在一切都awsebcli
正常了。
brew upgrade awsebcli
brew link --overwrite aws-elasticbeanstalk
eb --version
I get this warning when reinstall awsebcli: WARNING: The scripts eb and ebp are installed in '/Users//Library/Python/3.8/bin' which is not on PATH.重新安装 awsebcli 时收到此警告:警告:脚本 eb 和 ebp 安装在 '/Users//Library/Python/3.8/bin' 中,它不在 PATH 上。
In this case just add below path into your ~/.bash_profile is working fine.在这种情况下,只需将以下路径添加到您的 ~/.bash_profile 中即可。
export PATH=/Users/<you>/Library/Python/3.8/bin:$PATH
I had the same issue.我遇到过同样的问题。 Do not run "pip install awsebcli --upgrade --user" when you install it for the first time.
首次安装时不要运行“pip install awsebcli --upgrade --user”。 Run "pip install awsebcli" instead.
改为运行“pip install awsebcli”。
Steps to fix it:修复它的步骤:
After all above steps "eb --version" should display the correct version with no errors.完成上述所有步骤后,“eb --version”应该显示正确的版本,没有错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.