I'm trying to run a python application that uses psycopg2-binary==2.9.1, but I'm hitting this error:
psycopg2.OperationalError: SCRAM authentication requires libpq version 10 or above
When I check the version of libpq installed, it suggests I have 12.8:
sudo dpkg -l | grep libpq
ii libpq5:arm64 12.8-0ubuntu0.20.04.1 arm64 PostgreSQL C client library
I searched around and saw some recommendations to switch off scram authentication, so I changed authentication to md5 in pg_hba.conf and postgresql.conf and then reloaded config (and restarted my database).
I'm still getting this problem. Does anyone know what is wrong ? Thanks in advance
I'm using apple silicon (M1 Pro).
In my environment (python debian image on docker), the solution is to upgrade libpq and install build tools, then build psycopg2-binary from source.
ubuntu example code:
sudo apt update -y && sudo apt install -y build-essential libpq-dev
pip install psycopg2-binary --no-binary psycopg2-binary
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With