gpt4 book ai didi

postgresql - AWS ElasticBeanstalk 亚马逊 linux pg_config 错误与 psycopg2

转载 作者:行者123 更新时间:2023-11-29 13:22:47 25 4
gpt4 key购买 nike

我正在测试 AWS 以启动网络服务。我坚持使用 pg_config。错误日志为

/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 版本的数据库。

我认为 --pg-config 的路径有问题。但我无法改变它。

有什么解决办法吗??

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

最佳答案

您的原始帖子中存在语法错误,packages: 不应缩进。我不知道为什么当安装中包含 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 - AWS ElasticBeanstalk 亚马逊 linux pg_config 错误与 psycopg2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38911161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com