Psycopg2 on Amazon Elastic Beanstalk

狂风中的少年 提交于 2019-11-29 05:26:56

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.

I struggled for a while with and couldn't get the above solution to work. I tried many other solutions as well, but it ended up being a lack of fundamental understanding on my part.

The config files are read alphabetically. So if you have more than one, which you likely do, make sure that 'packages.config' comes alphabetically before your .config with container_commands.

Otherwise 'syncdb' for example will be called before your packages have been installed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!