- First, check that you have postgres and openssl installed
brew install openssl
orbrew reinstall openssl
brew install postgresql
orbrew reinstall postgresql
- If that doesn't help, try the following:
xcode-select --install
env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2