5

I've installed and configurated AWS Elastic Beanstalk Command Line Tool on my Mac.

That's what I have installed:

$ python --version
Python 2.7
$ ruby --version
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin10.8.0]
$ eb --version
AWS Elastic Beanstalk Command Line Interface v2.6.3

I have EB properly configured in order to use git with AWS

When I try to push a commit to AWS I am getting this error:

$ git aws.push
Traceback (most recent call last):
  File ".git/AWSDevTools/aws.elasticbeanstalk.push", line 21, in <module>
    from aws.dev_tools import * 
  File "/Applications/MAMP/htdocs/innbativel/.git/AWSDevTools/aws/dev_tools.py", line 3, in <module>
    from subprocess import check_output
ImportError: cannot import name check_output

Does anyone have an idea why and how to fix it?

cawecoy
  • 2,359
  • 4
  • 27
  • 36
  • 2
    No idea *why* you're getting the wrong `subprocess`, but `check_output` was added in version 2.7, so presumably something is somehow including a 2.6-or-earlier version of `subprocess`. – torek Aug 28 '14 at 01:48
  • @torek But how to make sure of it and fix the issue? – cawecoy Aug 28 '14 at 02:11
  • See http://stackoverflow.com/questions/247770/retrieving-python-module-path - you could modify the code to `import subprocess` and then look at the resulting path, before attempting the `from subprocess import check_output` part. For fixing it, you might find out why there's an old `subprocess` and whether it can be moved/removed, or tweak `sys.path`, or something. This goes back to the question of *why* you're getting the wrong `subprocess`. – torek Aug 28 '14 at 02:53
  • I see that, but since I don't know python well, I prefer don't mess with code. Ok, the problem was python 2.6 pre-installed with my OSX. I just changed `aws.elasticbeanstalk.push` to use `python2.7` instead of `python` and it worked. I'm gonna write an answer soon. Thanks @torek! – cawecoy Aug 28 '14 at 03:05

1 Answers1

5

I found that my OSX comes with python 2.6 (which doesn't have check_output) and it was conflicting with python 2.7 that I've installed for EB CLI.

To solve this, I just made .git/AWSDevTools/aws.elasticbeanstalk.push use python 2.7, in its first line:

#!/usr/bin/env python2.7
cawecoy
  • 2,359
  • 4
  • 27
  • 36