psycopg2
https://pypi.org/project/psycopg2/
Psycopg 2 is mostly implemented in C as a libpq wrapper,
(Dockerコンテナにする場合)libpqが必要そう
The psycopg2 package is still widely used and actively maintained, but it is not expected to receive new features.
👉 psycopg(3系)
#PostgreSQL
It is currently at version 2.x, which is a complete rewrite of the original 1.x code to provide new-style classes for connection and cursor objects and other sweet candies.
ref: https://wiki.postgresql.org/wiki/Psycopg
macOSでのインストールにて
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory containing pg_config to the $PATH or specify the full executable path with the option:
or with the pg_config option in 'setup.cfg'.
PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH" pip install psycopg2
postgresql (Homebrew Formulae)のインストールで作られたpg_configをPATHで指定した
過去 https://github.com/ftnext/my-first-blog-django3/issues/3#issuecomment-599190586