elastic beanstalk, awsebcli, and blessed 1.9.5
Question: 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](http://stackoverflow.com/questions/33665282/how-can-i-configure-
blessed-1-9-5-with-python-in-ubuntu) 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?


Answer: 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.

