Getting Started with Python on Heroku - pg_config executable not found

假装没事ソ 提交于 2020-01-14 10:43:36

问题


I have been following the documentation until I got to the point of installing the requirements.txt file. It always fails when trying to install line 6 "psycopg2==2.5.3". Here is the message -

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'.

Of course I found several posts on this. So I started checking things. I believe that postgres app for mac comes with psycopg2. I do have postgres added to my path and checked in terminal running "echo $PATH". I do not have any other old versions conflicting. And postgres documentation says I should have it added to my path like this -

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

I have restarted postgres app, deactivated and restarted virtual env and I get the same error no matter what.

What could I possibly be overlooking! I have read and read other posts on here, and even blogs covering this issue.


回答1:


After reading dozens of the same errors people were all having with the postgres mac app. I decided to install postgres via brew and now it all works just fine.



来源:https://stackoverflow.com/questions/25636580/getting-started-with-python-on-heroku-pg-config-executable-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!