Skip to content

Installation

Installing with pip

The easiest way to install pg4j is using pip. The name of the package on pypi.com is pg4j.

$ pip install pg4j
---> 100%
Successfully installed pg4j

One thing to note is that pg4j relies on a sqlalchemy's postgres dialect which uses the pyscopg2 driver. This means that postgresql-client tools must be installed on the machine installing pg4j.

On linux this can be achieved through the following command:

brew install postgresql

On linux this can be achieved through the following command (note apt-get may need to be replaced by the specific linux distro's package manager):

sudo apt-get install postgresql-client

Installing using Git

# Get DBgen
git clone https://github.com/modelyst/pg4j
cd ./pg4j
# Get Poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
# Install Poetry
poetry install
poetry shell
# Test pg4j
pg4j version