Webサービスを起動するためにAWSをテストしています。 私はpg_configを使いました。エラーログはAWS ElasticBeanstalk amazon linux psgopg2の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バージョンのDBを使用しています。
私は--pg-configのパスが問題だと思います。私はそれを変更することはできません。
解決策はありますか?
p.s私はSSHなどでEC2インスタンス内にセットアップしたくありません。
この時点では、postgresqlバージョンの問題でした。 ダウングレード版を使用して解決しました。 9.5ではなく9.4 このとき、これは修正されていると思います。 – 101110101100111111101101