OS X Sierra, PostgreSQL and Psycopg2
This is a classic post explaining how to install psycopg2 ( a python driver for pgsql ) and a virtualenv environment.
The first step is download the PostgreSQL server from the official page.
After the PgSQL installation it’s time to install the drivers for python.