Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Started with Python on Heroku - pg_config executable not found

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.

like image 858
wannabe programmer Avatar asked Oct 31 '22 17:10

wannabe programmer


1 Answers

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.

like image 74
wannabe programmer Avatar answered Nov 15 '22 04:11

wannabe programmer