install Psycopg2 on mac osx 10.9.5

I ran pip install psycopg2-binary and it worked like charm

More info about the binary package


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.


To install psycopg2 you need have installed server before( I have installed PostgresApp)

Run manually command including the path of pg_config program in PATH env variable, in my case:

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

and then run

pip3 install psycopg2

EDIT:

Check directory of pg_config:

which pg_config