Install Python Packages On Elastic Beanstalk


To install Python packages on Amazon Beanstalk, we have to run add a command in our .ebextension/*.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.
    command: 'easy_install termcolor'

See Amazon's documentation for more info.


Logs of the execution of .ebextension/*.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
Best match: termcolor 1.1.0
Quentin Pleplé
May 2014