[英]Can't figure out where Heroku app is failing [Error: pg_config executable not found.]
Hoping you can help me figure this one out.希望你能帮我解决这个问题。 I'm slogging through the Heroku 'Getting Started with Python' page where you install the necessary dependencies to run an app locally.
我正在浏览Heroku 的“Python 入门”页面,您可以在其中安装必要的依赖项以在本地运行应用程序。 It all works well up until the 2nd to last step, running the command
virtualenv venv
.直到第二步到最后一步,运行命令
virtualenv venv
之前,一切都运行良好。 I run that, then the next command, pip install -r requirements.txt --allow-all-external
, and that's where I get this error:我运行它,然后执行下一个命令
pip install -r requirements.txt --allow-all-external
,这就是我收到此错误的地方:
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'.
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_nickcode/psycopg2
Storing debug log for failure in /tmp/tmpb5tCeK
I don't understand why I'm getting this error.我不明白为什么我会收到这个错误。 Can anyone help me make sense of it?
任何人都可以帮助我理解它吗?
My version of requirements.txt:我的requirements.txt版本:
dj-database-url==0.3.0
Django==1.8.1
django-postgrespool==0.3.0
gunicorn==19.3.0
psycopg2==2.6
SQLAlchemy==1.0.4
whitenoise==1.0.6
pg_config is part of postgresql ( http://www.postgresql.org/docs/8.1/static/app-pgconfig.html ). pg_config 是 postgresql ( http://www.postgresql.org/docs/8.1/static/app-pgconfig.html ) 的一部分。 So you need to install postgresql.
所以你需要安装postgresql。
brew install postgresql
在 macOS 上解决了这个问题
I have overcame this issue defining a environment variable HEROKU and putting the following lines at the end of settings.py我已经克服了这个问题,定义了一个环境变量 HEROKU 并将以下几行放在 settings.py 的末尾
if config('HEROKU', cast=bool, default=False):
import django_heroku
django_heroku.settings(locals())
Additionally, I've include an worker in Procfile to install the django-heroku just for use in Heroku此外,我在 Procfile 中包含了一个工人来安装 django-heroku 仅用于 Heroku
worker: python -m pip install django-heroku
release: python manage.py migrate --noinput
web: gunicorn myapp.wsgi --log-file -
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.