Install PostgreSQL client#

To connect to a PostgreSQL database from Python, you need a client library. We recommend using psycopg2, but there are others like pg8000, and asyncpg. JupySQL supports the following connectors.

Installing psycopg2#

The simplest way to install psycopg2 is with the following command:

pip install psycopg2-binary

If you have conda installed, it is more reliable to use it:

conda install psycopg2 -c conda-forge

Installing pgspecial#

Ensure that you are using pgspecial 1.x. pgspecial 2.x has migrated to psycopg3 and thus does not yield informative error messages.

conda install "pgspecial<2" -c conda-forge

If you have trouble getting it to work, message us on Slack.