Postgresql AWS ElasticBeanstalk amazon linux pg_配置错误与psycopg2

Postgresql AWS ElasticBeanstalk amazon linux pg_配置错误与psycopg2,postgresql,amazon-web-services,amazon-elastic-beanstalk,Postgresql,Amazon Web Services,Amazon Elastic Beanstalk,我正在测试AWS以启动web服务。 我坚持使用pg_配置。错误日志为 /app/requirements.txt (line 1)) Using cached psycopg2-2.6.2.tar.gz Complete output from command python setup.py egg_info: running egg_info creating pip-egg-info/psycopg2.egg-info writing pip-egg-info/psycopg

我正在测试AWS以启动web服务。 我坚持使用pg_配置。错误日志为

/app/requirements.txt (line 1))
Using cached psycopg2-2.6.2.tar.gz
  Complete output from command python setup.py egg_info:
  running egg_info
  creating pip-egg-info/psycopg2.egg-info
  writing pip-egg-info/psycopg2.egg-info/PKG-INFO
  writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
  writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
  writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
  warning: manifest_maker: standard file '-c' not found

  Error: pg_config executable not found.

  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'.
stackoverflow中有很多解决方案,但它对我不起作用

  packages:
  yum:
    python-devel: []
    postgresql95-devel: []
    libjpeg-devel: '6b'

container_commands:
  01_migrate:
    command: "python manage.py migrate"
  02_collectstatic:
    command: "python manage.py collectstatic --noinput"
  03_createsu:
    command: "python manage.py createsu"
    leader_only: true

option_settings:
  "aws:elasticbeanstalk:application:environment":
    DJANGO_SETTINGS_MODULE: "onreview.settings"
    PYTHONPATH: "$PYTHONPATH"
  "aws:elasticbeanstalk:container:python":
    WSGIPath: "onreview/wsgi.py"
这是我的.ebextensions/python.config文件内容。我正在通过压缩我的源代码上传

我把postgresql95-devel改成了postgresql-devel,93,94,全都是。我现在使用的是9.5版本的db

我认为--pg config的路径是个问题。但我不能改变它

有什么解决办法吗


p、 我不想通过SSH或其他方式在EC2实例内部进行设置。

您的原始帖子中有语法错误,
包:
不应缩进。我不知道当python包含在安装中时为什么要使用python-devel,所以我不能说它没有干扰。同样,行设置python路径

packages:
  yum:
    python-devel: []
    postgresql95-devel: []
    libjpeg-devel: '6b'

container_commands:
  01_migrate:
    command: "python manage.py migrate"
  02_collectstatic:
    command: "python manage.py collectstatic --noinput"
  03_createsu:
    command: "python manage.py createsu"
    leader_only: true

option_settings:
  aws:elasticbeanstalk:application:environment:
    DJANGO_SETTINGS_MODULE: "onreview.settings"
    PYTHONPATH: "$PYTHONPATH"
  aws:elasticbeanstalk:container:python:
    WSGIPath: "onreview/wsgi.py"

当时,这是postgresql版本的问题。我是用降级版本解决的。这次不是9.5而是9.4,我想这是固定的。