在python连接PG或者KINGBASE时,报错:SCRAM authentication requires libpq version 10 or above
已安装版本:
psycopg2 2.9.7
解决:
- 下载最新版本的psycopg2-binary
- 卸载原来psycopg2
pip3 uninstall psycopg2
- 安装psycopg2-binary
-
cd psycopg2-binary-2.9.9 python3 setup.py install
2024-9-3更新:
今天在另外一个环境发现用以上的方法无法解决问题
这个环境已安装postgres相关的软件包有:
# rpm -qa | grep post
rh-postgresql12-postgresql-devel-12.11-1.el7.x86_64
postgresql-libs-9.2.24-1.el7_5.x86_64
postgresql-devel-9.2.24-1.el7_5.x86_64
rh-postgresql12-postgresql-libs-12.11-1.el7.x86_64
postgresql-9.2.24-1.el7_5.x86_64
rh-postgresql12-runtime-3.4-1.el7.x86_64
解决方法:
卸载:
rpm -e postgresql-libs postgresql-devel postgresql
pip3 uninstall psycopg2
安装 psycopg2:
cd psycopg2-2.9.7
python3 setup.py install