Libpq.so.5: cannot open shared object file: No such file or directory

$ python3 --version
Python 3.9.6

$ pip3 list
Package                   Version
------------------------- -----------
aiodns                    2.0.0
aiohttp                   3.7.4.post0
async-timeout             3.0.1
attrs                     21.2.0
ccxt                      1.52.75
certifi                   2021.5.30
cffi                      1.14.6
chardet                   4.0.0
cryptography              3.4.7
erlastic                  2.0.0
idna                      2.10
loguru                    0.5.3
multidict                 5.1.0
pip                       21.2.3
psycopg2                  2.9.1
pycares                   4.0.0
pycparser                 2.20
pypi                      2.1
python-axolotl-curve25519 0.4.1.post2
requests                  2.25.1
setuptools                56.0.0
simplejson                3.17.3
typing-extensions         3.10.0.0
urllib3                   1.26.6
yarl                      1.6.3

from psycopg2._psycopg import (# noqa ImportError: libpq.so.5: cannot open shared object file: No such file or directory

How is this issue resolved?

You need to install the postgresql package (either a complete one or a least the development package) for your operating system. Consult your operating system (and it’s package manager) documentation for further details. Should be a google away at most, hopefully.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.