简体   繁体   English

无法找出 Heroku 应用程序失败的地方 [错误:找不到 pg_config 可执行文件。]

[英]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.

相关问题 我正在尝试下载 Django-heroku。 但我收到此错误:找不到 pg_config 可执行文件。,如何解决? - I am trying to download Django-heroku. But I am getting this Error: pg_config executable not found., how to solve it? 错误:找不到 pg_config 可执行文件。 即使我在环境变量上添加了 pg_config 的路径 - Error: pg_config executable not found. even though I have added the path to pg_config on environment variable 没有名为“psycopg2”的模块和错误:找不到 pg_config 可执行文件。 尝试在 RHEL 7 上安装时 - No module named 'psycopg2' and Error: pg_config executable not found. when trying to install on RHEL 7 找不到 pg_config 可执行文件 - pg_config executable not found Heroku上的Python入门 - 找不到pg_config可执行文件 - Getting Started with Python on Heroku - pg_config executable not found Pipenv 锁定失败:错误:找不到 pg_config 可执行文件 - Pipenv Locking Failed: Error: pg_config executable not found Mac + virtualenv + pip + postgresql = 错误:找不到 pg_config 可执行文件 - Mac + virtualenv + pip + postgresql = Error: pg_config executable not found 从源安装 Odoo:错误:找不到 pg_config 可执行文件 - Install Odoo from sourcce: Error: pg_config executable not found 无法为烧瓶应用程序安装pg_config - Can't install pg_config for flask app 错误:在 Docker 中的 Alpine 上安装 psycopg2 时找不到 pg_config 可执行文件 - Error: pg_config executable not found when installing psycopg2 on Alpine in Docker
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM