Error: pg_config executable not found. ld: library not found for -lssl

created at 08-18-2021 views: 1

Error: pg_config executable not found. ld: library not found for -lssl When install python psycopg2 in MacOS

solution

# download
wget -O psycopg2-2.8.6.tar.gz https://files.pythonhosted.org/packages/fd/ae/98cb7a0cbb1d748ee547b058b14604bd0e9bf285a8e0cc5d148f8a8a952e/psycopg2-2.8.6.tar.gz
tar -zxf psycopg2-2.8.6.tar.gz
cd psycopg2-2.8.6

# add pg_config configuration
vim setup.cfg
# modify pg_config of build_ext
# pg_config = /opt/homebrew/opt/postgresql@12/bin/pg_config

# install
LDFLAGS="-I/opt/homebrew/Cellar/openssl@1.1/1.1.1k/include -L/opt/homebrew/Cellar/openssl@1.1/1.1.1k/lib" /usr/local/bin/python setup.py install
created at:08-18-2021
edited at: 08-18-2021: