I assume OP's question about libpq
stemmed from them needed it for psycopg2
. From Postgres' documentation,
libpq is the C application programmer's interface to PostgreSQL. libpq is a set of library functions that allow client programs to pass queries to the PostgreSQL backend server and to receive the results of these queries. libpq is also the underlying engine for several other PostgreSQL application interfaces, including those written for C++, Perl, Python, Tcl and ECPG. So some aspects of libpq's behavior will be important to you if you use one of those packages.
A platform independent solution is to use Anaconda's distribution of Python. If you use Anaconda's Python distribution and you are trying to install psycopg2
, then libpq
will automatically be installed for you as it's listed as a requirement. Simply run the command,
conda install psycopg2
You will see the following output
(dummy) jon@MacBook-Pro % conda install psycopg2
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /Users/jon/miniconda3/envs/dummy
added / updated specs:
- psycopg2
The following packages will be downloaded:
package | build
---------------------------|-----------------
psycopg2-2.8.6 | py39hbcfaee0_1 141 KB
------------------------------------------------------------
Total: 141 KB
The following NEW packages will be INSTALLED:
krb5 pkgs/main/osx-64::krb5-1.19.2-hcd88c3b_0
libedit pkgs/main/osx-64::libedit-3.1.20210714-h9ed2024_0
libpq pkgs/main/osx-64::libpq-12.2-h1b4eb34_1
psycopg2 pkgs/main/osx-64::psycopg2-2.8.6-py39hbcfaee0_1
Proceed ([y]/n)?
libpq
will be in the list of items installed along with psycopg2
. Thus you should not have any dependency issues when trying to use psycopg2
.