The necessary Python 3 driver for connections to the PostgreSQL database is python3-psycopg2, as qualified by this earlier post with full test examples for Red Hat distributions. You can install it on Ubuntu with the following command:
sudo apt-get install -y python3-psycopg2
Display detailed console log →
python3-psycopg2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
python-psycopg2-doc
The following NEW packages will be installed:
python3-psycopg2
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 136 kB of archives.
After this operation, 483 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 python3-psycopg2 amd64 2.9.2-1build2 [136 kB]
Fetched 136 kB in 1s (146 kB/s)
Selecting previously unselected package python3-psycopg2.
(Reading database ... 204321 files and directories currently installed.)
Preparing to unpack .../python3-psycopg2_2.9.2-1build2_amd64.deb ...
Unpacking python3-psycopg2 (2.9.2-1build2) ...
Setting up python3-psycopg2 (2.9.2-1build2) ...
As always, I hope this helps those looking for a solution. Also, remember the referenced post above provides Linux distribution neutral full solutions.