Psycopg2 on Amazon Elastic Beanstalk

Need postgresql-devel in your container. Create a file '.ebextensions/packages.config' with the contents:

packages:
  yum:
    postgresql94-devel: []

Replace 94 in postgresql94-devel with whatever version of postgres you need. For example, postgresql93-devel for postgres 9.3.

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-packages


Tried to comment on the accepted answer but don't have the reputation to do so. Recent forum posts from AWS support indicate that the package name is "postgresql93-devel". postgresql-devel does not work in the 2014.09 AMIs.