macOS安装python psycopg2 Error: pg_config executable not found. ld: library not found for -lssl

Error

Error: pg_config executable not found. 

ld: library not found for -lssl

安装

# 下载
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

# 增加pg_config配置
vim setup.cfg
# 修改build_ext的pg_config
# 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

 

上一篇:PostgreSQL 与 Kingbase 的差异对比


下一篇:PostgreSQL查看索引、表对应的relfileno