Skip to content

Installation

Install Gres from PyPI:

uv add gres
pip install gres

Requirements

Requirement Detail
Python CPython 3.11 or newer, including free-threaded builds.
PostgreSQL Tested with PostgreSQL 19.0; see PostgreSQL compatibility.
Platforms Linux, macOS, and Windows. Prebuilt wheels need no compiler.
System libraries None. Gres implements the PostgreSQL wire protocol directly and does not use libpq.

Compatibility lists supported extensions, connection poolers, and the versioning policy.

Optional extras

Extra Installs Enables
postgis gometry Computational geometry and geography. Exact EWKB transfer needs no extra.
sqlalchemy SQLAlchemy 2.1 with asyncio The postgresql+gres dialect.
opentelemetry opentelemetry-api Spans and metrics.
kerberos gssapi, or sspilib on Windows Kerberos and SSPI authentication.
uv add 'gres[postgis,sqlalchemy]'
pip install 'gres[postgis,sqlalchemy]'

Arrow interchange uses arro3-core, which is always installed. PyArrow, Polars, and other Arrow libraries are optional and exchange data via the Arrow PyCapsule interface.

Build from source

Installing from a source distribution compiles the Rust extension and requires a C toolchain plus the Rust toolchain pinned by rust-toolchain.toml in the repository.