简体   繁体   English

安装EB CLI 3.x后出现错误

[英]Error after installing EB CLI 3.x

I am trying to install the elastic beanstalk CLI on an EC2 instance (running AMI) using these instructions: 我正在尝试使用以下说明在EC2实例(运行AMI)上安装Elastic beanstalk CLI:

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

I have python 2.7.9 installed, pip and eb. 我安装了python 2.7.9,pip和eb。 However, when I try to run eb I get the error below. 但是,当我尝试运行eb时,出现以下错误。 It looks like it is still using python 2.6. 看起来它仍在使用python 2.6。 How do you fix that? 您如何解决?

Thanks! 谢谢!

Traceback (most recent call last):
  File "/usr/bin/eb", line 9, in <module>
    load_entry_point('awsebcli==3.0.10', 'console_scripts', 'eb')()
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 473, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2568, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2259, in load
    ['__name__'])
  File "/usr/lib/python2.6/site-packages/ebcli/core/ebcore.py", line 23, in <module>
    from ..controllers.initialize import InitController
  File "/usr/lib/python2.6/site-packages/ebcli/controllers/initialize.py", line 16, in <module>
    from ..core.abstractcontroller import AbstractBaseController
  File "/usr/lib/python2.6/site-packages/ebcli/core/abstractcontroller.py", line 21, in <module>
    from ..core import io, fileoperations, operations
  File "/usr/lib/python2.6/site-packages/ebcli/core/operations.py", line 762
    vars = {n['OptionName']: n['Value'] for n in settings
                                          ^
SyntaxError: invalid syntax

Pip is probably set up with Python 2.6 instead of python 2.7. Pip可能是使用python 2.6而不是python 2.7设置的。

pip --version

You can reinstall pip with Python 2.7, then reinstall 2.6 您可以使用Python 2.7重新安装pip,然后重新安装2.6

pip uninstall awsebcli
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install awsebcli

I had the same problem, the fix for me was actually to upgrade to latest Beanstalk stack ( eb upgrade ). 我遇到了同样的问题,对我来说,解决方法实际上是升级到最新的Beanstalk堆栈( eb upgrade )。 Note there are downtime etc. So investigate if you can run the latest stack before upgrading. 请注意有停机时间等。因此,请调查是否可以在升级之前运行最新的堆栈。

The "smartest" solution for me was to install python-dev tools 对我来说,“最聪明”的解决方案是安装python-dev工具

sudo apt install python-dev sudo apt安装python-dev

found here: 在这里找到:

http://ericbenson.azurewebsites.net/deployment-on-aws-elastic-beanstalk-for-ubuntu/ http://ericbenson.azurewebsites.net/deployment-on-aws-elastic-beanstalk-for-ubuntu/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM