【问题标题】:Getting Started with Python on Heroku - pg_config executable not found在 Heroku 上开始使用 Python - 找不到 pg_config 可执行文件
【发布时间】:2014-10-27 11:56:06
【问题描述】:

在安装 requirements.txt 文件之前,我一直在关注文档。尝试安装第 6 行“psycopg2==2.5.3”时总是失败。这是消息 -

Downloading/unpacking psycopg2==2.5.3 (from -r requirements.txt (line 6))
Downloading psycopg2-2.5.3.tar.gz (690kB): 690kB downloaded
Running setup.py (path:/Users/pimpc/Sites/python/herokudemo/python-getting-started/venv/build/psycopg2/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

creating pip-egg-info/psycopg2.egg-info

writing pip-egg-info/psycopg2.egg-info/PKG-INFO

writing top-level names to
pip-egg-info/psycopg2.egg-info/top_level.txt

writing dependency_links to
pip-egg-info/psycopg2.egg-info/dependency_links.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'.

当然,我找到了几篇关于此的帖子。所以我开始检查事情。我相信用于 mac 的 postgres 应用程序带有 psycopg2。我确实已将 postgres 添加到我的路径中,并在运行“echo $PATH”的终端中签入。我没有任何其他旧版本冲突。 postgres 文档说我应该像这样将它添加到我的路径中 -

export PATH="/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH:$PATH"

我已重新启动 postgres 应用程序,停用并重新启动虚拟环境,无论如何我都会收到相同的错误。

我可能会忽略什么!我已经阅读并阅读了此处的其他帖子,甚至包括有关此问题的博客。

【问题讨论】:

标签: python postgresql heroku


【解决方案1】:

在阅读了人们在使用 postgres mac 应用程序时遇到的几十个相同的错误之后。我决定通过 brew 安装 postgres,现在一切正常。

【讨论】:

    猜你喜欢
    • 2012-07-22
    • 2021-10-31
    相关资源
    最近更新 更多