Skip to content

Getting Started

The following will guide you through the installation of the package and the first steps to use it.

Prerequisites

PathpyG is available for Python versions 3.10 and above. It is not recommended to install it on your system Python. Instead, we recommend using a virtual environment such as conda or virtualenv. You can also set up a Docker image as described in the next section.

Installation

Once you have an environment up and running, you can install the package simply via pip. But first make sure that you installed the necessary dependencies.

Dependencies

This package is based on PyTorch and PyTorch Geometric. Please install both libraries before installing PathpyG. You can follow the installation instructions in their respective documentation ( PyTorch and PyG). Alternatively, you can install the correct versions of both libraries using uv to install the optional dependencies of PathpyG. You can choose between a CPU-only installation or a CUDA installation for a specific CUDA version. For example, to install the CPU-only version, run:

uv pip install pathpyg[cpu]
Or, to install the CUDA 12.9 version, run:

uv pip install pathpyg[cu129]

Warning

We currently only support PyG version 2.5.0 and above.

Install Stable Release

You can install the latest stable release of PathpyG via pip:

TODO

This is not yet available. We will release the first stable version soon.

pip install pathpyg

Install Latest Development Version

If you want to install the latest development version, you can do so via pip directly from the GitHub repository:

pip install git+https://github.com/pathpy/pathpyG.git

Optional Visualisation Backends

We provide multiple visualisation backends for PathpyG. The default backend D3.js does not require any additional dependencies. We further provide a Matplotlib backend that is installed by default. Additionally, we implemented a tikz and a Manim backend that are not installed by default due to their dependencies that are required for installation. You can use the tikz backend if you have a LaTeX distribution installed on your system.

To use the Manim backend, please refer to the Manim installation instructions for more information. Once installed, you can use the backends for visualisation by setting the backend in the PathpyG.plot function to tikz or manim:

Using the TikZ Backend
import pathpyg as pp

g = pp.Graph.from_edge_list([('a', 'b'),('b', 'c'),('c', 'a')])
pp.plot(g, backend='tikz')
Using the Manim Backend
import pathpyg as pp

t_graph = TemporalGraph.from_edge_list([('a', 'b', 1),('b', 'a', 3), ('b', 'c', 3)])
pp.plot(t_graph, backend='manim')