DEV Community

Yujin
Yujin

Posted on • Originally published at jinyuz.dev on

Installing Psycopg2 in Macos

TL;DR

env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2


# OR

env LDFLAGS="-I/usr/local/opt/openssl@3/include -L/usr/local/opt/openssl@3/lib" pip install psycopg2

# OR

# https://github.com/brianmario/mysql2/issues/795#issuecomment-337006164

env LIBRARY_PATH="/usr/local/opt/openssl@3/lib" pip install psycopg2 --no-cache

Enter fullscreen mode Exit fullscreen mode

Source: https://stackoverflow.com/questions/26288042/error-installing-psycopg2-library-not-found-for-lssl/39244687#39244687

The reason is that probably it might work faster in my machine if it was installed using the not binary version

Top comments (0)