Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

elastic beanstalk, awsebcli, and blessed 1.9.5

I was using the elastic beanstalk cli with AWS without any difficulty a few months ago. I wanted to update my website and ran into this error:

me$ eb status Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/bin/eb", line 5, in from pkg_resources import load_entry_point File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/init.py", line 3095, in @_call_aside File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/init.py", line 3081, in _call_aside f(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/init.py", line 3108, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/init.py", line 660, in _build_master return cls._build_from_requirements(requires) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/init.py", line 673, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/init.py", line 846, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'blessed==1.9.5' distribution was not found and is required by awsebcli

I haven't been able to find anything about this error, except for a question about how to deal with a similar problem on ubuntu (I'm on a Mac) that has gone unanswered for a month.

Does anyone have any ideas?

like image 518
hartshoj Avatar asked Dec 15 '15 20:12

hartshoj


People also ask

What is Awsebcli?

PDF. The EB CLI is a command line interface for AWS Elastic Beanstalk that provides interactive commands that simplify creating, updating and monitoring environments from a local repository. Use the EB CLI as part of your everyday development and testing cycle as an alternative to the Elastic Beanstalk console.

How do you get the Elastic Beanstalk command line?

The easiest and recommended way to install the EB CLI is to use the EB CLI setup scripts available on GitHub. Use the scripts to install the EB CLI on Linux, macOS, or Windows. The scripts install the EB CLI and its dependencies, including Python and pip . The scripts also create a virtual environment for the EB CLI.


1 Answers

This is most likely caused by the fact that the eb script is using Apple's Python interpreter instead of the one you installed yourself.

There are two workarounds:

1. Run the EB CLI in a virtual environment

  1. Create a virtual environment for the EB CLI by running virtualenv ~/eb_cli_env.
  2. Run source ~/eb_cli_env/bin/activate to activate the created virtual environment.
  3. Run pip install awsebcli.

After that, you should be able to use the eb command just fine. You will have to run source ~/eb_cli_env/bin/activate every time before you can use the EB CLI.

--OR--

2. Edit the shebang line in the eb script

  1. Run vim /usr/local/bin/eb.
  2. Change the first line from #!/usr/bin/python to #!/usr/bin/env python.

This will ensure the eb command works globally without using a virtual environment, however it is very likely that if you upgrade the awsebcli package you will have to edit the shebang line again.

like image 135
Johannes Liebermann Avatar answered Sep 20 '22 00:09

Johannes Liebermann