Psycopg2在Amazon Elastic魔豆 [英] Psycopg2 on Amazon Elastic Beanstalk
问题描述
我试图上传我的项目(在python),使用Psycopg2亚马逊弹性魔豆。我这样做有一个zip文件,其中包含我的项目和requirements.txt文件。
不过,我收到此错误:
下载/解压缩psycopg2> = 2.4.6(来自-r /opt/python/ondeck/app/requirements.txt(3号线))运行setup.py egg_info的包psycopg2 错误:pg_config可执行找不到
请添加包含pg_config到PATH目录 或指定与选项的完整的可执行文件路径: 蟒蛇setup.py build_ext --pg-配置/路径/要/ pg_config建... 或者在setup.cfg'的pg_config选项。 从命令python setup.py egg_info完整的输出: 运行egg_info
我该如何解决这个在亚马逊?
需要的PostgreSQL-devel软件包在你的容器。 创建一个文件.ebextensions / packages.config的内容:
套餐:
百胜:
PostgreSQL的-devel软件包:[]
<一个href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-packages">http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-packages
I'm trying upload my project (in python) that uses Psycopg2 for Amazon Elastic Beanstalk. I'm doing this with a zip file containing my project and an requirements.txt file.
But I'm receiving this error:
Downloading/unpacking psycopg2>=2.4.6 (from -r /opt/python/ondeck/app/requirements.txt (line 3)) Running setup.py egg_info for package psycopg2 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'. Complete output from command python setup.py egg_info: running egg_info
How can I solve this on Amazon?
Need postgresql-devel in your container. Create a file '.ebextensions/packages.config' with the contents:
packages:
yum:
postgresql-devel: []
这篇关于Psycopg2在Amazon Elastic魔豆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!