Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an application I need to host in Elastic Beanstock. The app requires Python 2.7 but Elastic Beanstock only supports Python 2.6.

I would like to install Python 2.7 on deploy. Here is the config.


    python27.x86_64: '2.7.3'                                                                                                                                                                                                                                   

    command: "virtualenv -p /usr/bin/python27 /opt/python/run/venv27"                                                                                                                                                                                          
    command: "source /opt/python/run/venv27/bin/activate"                                                                                                                                                                                                      
    command: "pip install -r /opt/python/current/app/requirements.txt"

When I create the application, I get:

ERROR: Responses from [xxxxxxxx] were received, but the commands failed.

When I ssh in, I don't see the package.


share|improve this question

migrated from Jun 13 '13 at 6:09

This question came from our site for professional and enthusiast programmers.


Here’s the .ebextensions/python27.config I've written to get everything set up. I’ll explain what each part of the config does inline.

# Yum install the packages we need for python2.7
# on the EC2 box. python27-devel, make and httpd-devel
# are required for getting modwsgi setup with python27.
    python27: []
    python27-devel: []
    make: []
    httpd-devel: []

  # The modwsgi version currently installed on the system
  # is built with support for python2.6 only. This
  # command compiles and installs modwsgi with python2.7 support.
    command: '[ -f mod_wsgi-3.4.tar.gz ] && echo "mod_wsgi-3.4 is already installed" || { wget; tar xzvf mod_wsgi-3.4.tar.gz; cd mod_wsgi-3.4; ./configure --with-python=python27; make; make install; } | iconv -f utf-8 -t us-ascii//TRANSLIT'

  # When our app is being deployed a virtualenv is setup
  # automatically for us. This injects the --python=python2.7
  # argument into the virtualenv CLI. This tells virtualenv to
  # use python2.7 instead of the default python2.6.
    command: grep "python2.7" || sed -i 's/--distribute/--python=python2.7 &/'
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre

  # Now that our app is installed using python2.7 we
  # need to fix some paths that the wsgi configuration
  # has pointing to python2.6. Copy the default eb wsgi.conf,
  # check it into git and replace the paths pointing
  # to python2.6. Check this diff out for the changes required:
    command: scp /opt/python/ondeck/app/wsgi.conf /opt/python/ondeck/wsgi

The author also has a Git repo with all the scripts and files necessary to set this up.

share|improve this answer

similar situation is described here with details on how to solve

share|improve this answer
Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Canadian Luke Jun 13 '13 at 22:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .