<p>I deployed a pod and service of a Flask API in Kubernetes.</p>
<p>When I run the Nifi processor InvoqueHTTP that calls the API, I have the error :</p>
<pre><code>File &quot;/opt/app-root/lib64/python3.8/site-packages/psycopg2/__init__.py&quot;
</code></pre>
<p><code>psycopg2.OperationalError: SCRAM authentication requires libpq version 10 or above</code></p>
<p>The API connects to  PGAAS database, in local it is running fine to connect but in the Kubernetes pod I need libpq library but I'm not finding the right library to install.
I also tried to install psycopg2-binary and it's throwing the same error.</p>
<p>Do you have any idea how to solve this issue ?</p>
<p>version tried in requirements : psycopg2==2.9.3 or psycopg2-binary==2.9.5</p>

<p>For  psycopg2.OperationalError: SCRAM authentication requires libpq version 10 or above follow the below work arounds:</p>
<p><strong>Solution :1</strong></p>
<p>Download libpq.dll from <a href="https://www.exefiles.com/en/dll/libpq-dll/" rel="nofollow noreferrer">https://www.exefiles.com/en/dll/libpq-dll/</a> then replace old libpq.dll at php directory with the latest downloaded</p>
<p><strong>Solution :2</strong></p>
<p>Change authentication to md5, then reset your password and restart the postgresql service and here are step by step:</p>
<ul>
<li>Find file postgresql.conf in C:\Program Files\PostgreSQL\13\data then set password_encryption = md5</li>
<li>Find file pg_hba.conf in C:\Program Files\PostgreSQL\13\data then change all METHOD to md5</li>
<li>Open command line (cmd,cmder,git bash...) and run <code>psql -U postgres</code> then enter your password when installed postgres sql
-Then change your password by running ALTER USER <code>postgres WITH PASSWORD 'new-password';</code> in command line</li>
<li>Restart service postgresql in your Service</li>
</ul>
<p><strong>Solution :3</strong></p>
<p>Check if psycopg is using the additional copy of libpq that may be  present on your computer. Recognize that file, then upgrade or remove it. Perhaps psycopg has to be updated for that.</p>
