9
votes

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?

3

3 Answers

8
votes

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.

4
votes

My suggestion is to install by brew on osx.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html#eb-cli3-install-osx

In my case I remove my previous installation by pip:

pip uninstall awsebcli

and run

brew install awsebcli
0
votes
sudo pip install https://pypi.python.org/packages/2.7/b/blessed/blessed-1.9.5-py2.py3-none-any.whl

All I could find