Source: https://gres.monicz.dev/installation/

# Installation

Install Gres from [PyPI](https://pypi.org/project/gres/):

**uv**

```bash
uv add gres
```

**pip**

```bash
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](https://gres.monicz.dev/about/compatibility/#postgresql). |
| 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](https://www.postgresql.org/docs/current/libpq.html). |

[Compatibility](https://gres.monicz.dev/about/compatibility/) lists supported extensions, connection poolers, and the versioning policy.

## Optional extras

| Extra | Installs | Enables |
| --- | --- | --- |
| `postgis` | [gometry](https://gometry.monicz.dev/) | [Computational geometry and geography](https://gres.monicz.dev/guide/spatial/). Exact EWKB transfer needs no extra. |
| `sqlalchemy` | [SQLAlchemy](https://www.sqlalchemy.org/) 2.1 with asyncio | The [`postgresql+gres` dialect](https://gres.monicz.dev/guide/sqlalchemy/). |
| `opentelemetry` | [`opentelemetry-api`](https://opentelemetry.io/docs/languages/python/) | [Spans and metrics](https://gres.monicz.dev/guide/observability/). |
| `kerberos` | `gssapi`, or `sspilib` on Windows | [Kerberos and SSPI authentication](https://gres.monicz.dev/guide/connections/#kerberos-and-sspi). |

**uv**

```bash
uv add 'gres[postgis,sqlalchemy]'
```

**pip**

```bash
pip install 'gres[postgis,sqlalchemy]'
```

Arrow interchange uses [`arro3-core`](https://kylebarron.dev/arro3/latest/), which is always installed. PyArrow, Polars, and other Arrow libraries are optional and exchange data via the [Arrow PyCapsule interface](https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html).

## 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](https://github.com/Zaczero/pkgs/tree/main/gres).
