(psycopg2.OperationalError) SCRAM authentication requires libpq version 10 or above (python:3.7-slim)

Good morning, currently we use python: 3.7-slim with an architecture amr64, we use libpq-dev, in the container it has version 13.5-0 + deb11u1, but when updating from dependency psycopg2-binary from 2.8.6 to 2.9.3 we got the title error, the strange thing is that when using version 2.9.3 of psycopg2-binary python use version 9 of libpq instead of the one with the container , we already tested it with python: 3.7-slim and python: 3.7-slim-bullseye.

NOTE: we already tried to change the architecture to an amd but the performance of the project is not good, we also tried to install the binary packages but it does not update the version of libpq that uses python

psycopg2-binary==2.8.6

root@7d05259cd499:/app# dpkg -l | grep libpq
ii  libpq-dev                 13.5-0+deb11u1               arm64        header files for libpq5 (PostgreSQL library)
ii  libpq5:arm64              13.5-0+deb11u1               arm64        PostgreSQL C client library
root@7d05259cd499:/app# dpkg --print-architecture
arm64
root@7d05259cd499:/app# python
Python 3.7.12 (default, Dec 21 2021, 07:43:33) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> v
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'v' is not defined
>>> import psycopg2
>>> print(psycopg2.__libpq_version__)
130005
>>> print(psycopg2.extensions.libpq_version())
130005
>>> exit()

psycopg2-binary==2.9.3

root@07c0225f0e5e:/app# dpkg -l | grep libpq
ii  libpq-dev                 13.5-0+deb11u1               arm64        header files for libpq5 (PostgreSQL library)
ii  libpq5:arm64              13.5-0+deb11u1               arm64        PostgreSQL C client library
root@07c0225f0e5e:/app# dpkg --print-architecture
arm64
root@07c0225f0e5e:/app# python
Python 3.7.12 (default, Dec 21 2021, 07:43:33) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>> print(psycopg2.__libpq_version__)
90624
>>> print(psycopg2.extensions.libpq_version())
90624