简体   繁体   中英

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:

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

I have python 2.7.9 installed, pip and eb. However, when I try to run eb I get the error below. It looks like it is still using 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 --version

You can reinstall pip with Python 2.7, then reinstall 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 ). 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

sudo apt install python-dev

found here:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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