Installing psycopg2 in virtualenv on macOS Sierra
$ xcode-select --install $ brew install openssl $ virtualenv env $ . env/bin/activate $(env) env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2