We begin by ensuring multiple popular libraries are available. After following so many recipes in this book, it's extremely likely that many (or even all) of these are already installed. Yet it never hurts to be certain!
First in the list is Python's psycopg2 Postgres interface layer. Patroni uses this to connect to Postgres for various operations, and because it is so commonly used, it's already packaged by our distribution. Python libraries tend to evolve extremely quickly, so this isn't always possible.
Next we install pip, a Python-specific installation utility that can download and install Python packages from the Python Package Index. This is very similar to the Postgres Extension Network, but for popular Python packages. ...