Install Python Packages On AWS Elastic Beanstalk

🦖 This post was published in 2014 and is most likely outdated.

Install

To install Python packages on Amazon Beanstalk, we have to run add a command in our .ebextensions/*.config file. Amazon Linux AMIs in Beanstalk are not shipped with pip but easy_install.

# these commands run before the application and web server are
# set up and the application version file is extracted.
commands:
  01_install_termcolor:
    command: 'easy_install termcolor'

See Amazon’s documentation for more info.

Troubleshooting

Logs of the execution of .ebextensions/*.config files are found in /var/log/cfn-init.log.

You should see something like

[DEBUG] Running command 01_install_termcolor
[DEBUG] No test for command 01_install_termcolor
[INFO] Command 01_install_termcolor succeeded
[DEBUG] Command 01_install_termcolor output: Searching for termcolor
Reading http://pypi.python.org/simple/termcolor/
Best match: termcolor 1.1.0

Comments