Amazon Elastic Beanstalk上的Psycopg2

ECC*_*ECC 28 python psycopg2 amazon-web-services amazon-elastic-beanstalk

我正在尝试上传我的项目(在python中),它使用Psycopg2进行Amazon Elastic Beanstalk.我正在使用包含我的项目和requirements.txt文件的zip文件.

但是我收到了这个错误:

下载/解压缩psycopg2> = 2.4.6(来自-r /opt/python/ondeck/app/requirements.txt(第3行))运行setup.py egg_info for package psycopg2错误:找不到pg_config可执行文件.

Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.
Complete output from command python setup.py egg_info:
running egg_info
Run Code Online (Sandbox Code Playgroud)

我如何在亚马逊上解决这个问题?

spe*_*hil 47

需要在容器中使用postgresql-devel.使用以下内容创建文件'.ebextensions/packages.config':

packages:
  yum:
    postgresql94-devel: []
Run Code Online (Sandbox Code Playgroud)

替换94postgresql94-devel用任何你需要的Postgres版本.例如,postgresql93-devel对于postgres 9.3.

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

  • 我收到错误说"Yum没有postgresql-devel". (3认同)

Eri*_*rik 20

试图评论已接受的答案,但没有这样做的声誉.来自AWS支持的最新论坛帖子表明包名称为"postgresql93-devel".postgresql-devel在2014.09 AMI中不起作用.