Heroku上的Python入门 - 找不到pg_config可执行文件

时间:2014-09-03 05:04:35

标签: python postgresql heroku

我一直在关注文档,直到我开始安装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应用程序,停用并重新启动了虚拟环境,无论如何我都得到了同样的错误。

我可能会俯瞰什么!我已阅读并阅读此处的其他帖子,甚至还有关于此问题的博客。

1 个答案:

答案 0 :(得分:2)

在阅读了几十个相同的错误后,人们都在使用postgres mac app。我决定通过brew安装postgres,现在一切正常。