belgiums belgiums - 1 month ago 28
Python Question

install psycopg2 on mac osx 10.9.5 [pg_config] [pip]

I'm trying to install

psycopg2
on my macbook. I still get the same error. I found a lot of same questions on stackoverflow but no answer seems to work. I think it is outdated. I'm using:

Mac osx 10.9.5
Python 3.4.3


My error code is:


Running 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

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

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

---------------------------------------- Command python setup.py egg_info failed with error code 1 in
/Users/stevengerrits/build/psycopg2 Storing complete log in
/Users/stevengerrits/Library/Logs/pip.log

Answer

You don't seem to have postgres installed, check how to install postgresql in your system, one of the way is brew install postgresql (if you use homebrew- recommended) or download the postgres app from postgresapp.com, pg_config should come with postgres and psycopg2 is trying to find it.