Skip to main content

Install PostgreSQL with pip install pgvenv

Github PyPI pip installs

pgvenv is a Python package that embeds a fully isolated PostgreSQL installation in your virtual environmnent.

pip install pgvenv

PostgreSQL will be built from source, using --prefix=$VENVPATH. Its binaries (psql,pg_config,postgres etc.) will be put under venv/bin along with the pip, python3 binaries.

python3.11 -m venv ./venv

PGVERSION=17.4 CFLAGS="-O2" PGCONFIGUREFLAGS="--without-icu" \
./venv/bin/pip install pgvenv

You can now use your favorite scripts

./venv/bin/pg_config --version # PostgreSQL 17.4
./venv/bin/initdb ./pgdata
./venv/bin/postgres -D ./pgdata

Installation

This requires:

  • Autoreconf
  • The normal C compiler toolchain, such as gcc and make.

Release files for pgvenv 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pgvenv 0.1.1
File Size Uploaded
pgvenv-0.1.1.tar.gz 4.0 kB Details

Release files / pgvenv-0.1.1.tar.gz

Download URL pgvenv-0.1.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e56f07c00468f9819947eeeb5f545343ab6ff3faade63c40bb6917e6c8799229
BLAKE2b-256 checksum
How to use checksums
e5e3aac59c2fa566451fbb7e8832ebbdd7b26cee94571a496fe5dd65741bce14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page