Installation¶
ProbPipe requires Python 3.12 or later, and it installs JAX as a dependency.
ProbPipe is not yet on PyPI, so for now it needs to be installed directly from GitHub.
Until a release, the commands install the main branch, which is the version this documentation describes.
Since pip or uv needs to clone the repository to install it, you will also need Git.
The two distributions¶
ProbPipe has two distributions, and both install the same import package, probpipe:
| Distribution | What it installs | When to use it |
|---|---|---|
probpipe-core |
ProbPipe with JAX, BlackJAX, TensorFlow Probability, and ArviZ | A minimal install, to which you add the extras you need |
probpipe |
probpipe-core with the extras pymc, nutpie, and pyabc, and with bayesflow on Python 3.12 and 3.13 |
Running the tutorials |
The probpipe distribution depends on probpipe-core==0.2.0.dev0, which is not yet on PyPI.
Until it is, install the tutorials' set of extras through probpipe-core, as the commands below do.
Google Colab¶
Google Colab runs Python in your browser, so it needs no install of Python. To install the smallest set, run this in a code cell:
Colab comes with PyMC 5, which does not work with the ArviZ 1.x that ProbPipe requires.
The command therefore installs the pymc extra, and the extra upgrades PyMC.
To install the set the tutorials use, run this instead:
%pip install "probpipe-core[pymc,nutpie,pyabc,bayesflow] @ git+https://github.com/TARPS-group/prob-pipe.git@main"
If Colab's Python is 3.14, leave bayesflow out of the list, as !python --version shows.
The quickstart and the tutorials open with a cell that installs ProbPipe when they run on Colab.
pip¶
Create a virtual environment, activate it, and install ProbPipe into it:
python -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activate
pip install "probpipe-core @ git+https://github.com/TARPS-group/prob-pipe.git@main"
To install the set the tutorials use, name the extras in brackets:
pip install "probpipe-core[pymc,nutpie,pyabc,bayesflow] @ git+https://github.com/TARPS-group/prob-pipe.git@main"
On Python 3.14, leave bayesflow out of the list.
uv¶
In a project that uv manages, uv add installs ProbPipe and records it as a dependency in pyproject.toml:
In a virtual environment that is not a uv project, uv pip install takes the same arguments as pip install:
Both commands take extras in brackets, as pip does.
Extras¶
The extras add optional backends and tools:
| Extra | What it adds | When you need it |
|---|---|---|
stan |
BridgeStan and CmdStanPy | To write a model as a Stan program with StanModel, and to sample it with CmdStan through the method cmdstan_nuts |
pymc |
PyMC and matplotlib | To write a model in PyMC with PyMCModel, and to fit it with PyMC's methods pymc_nuts and pymc_advi |
nutpie |
nutpie | To sample a Stan or PyMC model with nutpie's NUTS sampler through the method nutpie_nuts, which condition_on selects first for those models |
bayesflow |
BayesFlow and Keras | For amortized neural simulation-based inference with learn_amortized_posterior, learn_amortized_likelihood, and learn_amortized_ratio |
pyabc |
pyabc | For simulation-based inference by sequential Monte Carlo approximate Bayesian computation (SMC-ABC), the method pyabc_smcabc |
prefect |
Prefect | To run a pipeline's functions as Prefect tasks and flows, and on a Ray cluster through Prefect, as Ray via Prefect describes |
viz |
matplotlib and graphviz | To draw the plots of the quickstart and the tutorials, and a provenance graph with provenance_dag |
Two extras need additional tools installed:
stan: CmdStan and a C++ toolchain, which compile Stan programs. CmdStanPy's commandinstall_cmdstaninstalls CmdStan, and the CmdStanPy installation guide lists the toolchain each operating system needs.bayesflow: Python 3.12 or 3.13, and the JAX backend of Keras. ProbPipe sets the environment variableKERAS_BACKENDtojaxwhen it first imports BayesFlow, unless the variable is already set. A program that imports Keras before then, or sets the variable to another backend, must setKERAS_BACKEND=jaxbefore its first import of Keras.
The extras docs and dev are for contributors, and the contributing guide uses them to set up a development environment.
New to Python?¶
Neither of these two ways needs Python installed beforehand:
- In the browser: open the quickstart in Google Colab from the badge at its top, which needs only a Google account.
- On your computer: install uv by following its installation guide. uv downloads a suitable Python version when it needs one. The command
uv init my-analysiscreates a project in the foldermy-analysis, and theuv addcommand of the uv section run in that folder installs ProbPipe into it. The commanduv run pythonthen starts Python in the project's environment.
The Python tutorial introduces the language itself.
Check the installation¶
This script imports ProbPipe and draws from a normal distribution with mean 3 and standard deviation 1:
import jax.numpy as jnp
import probpipe
from probpipe import Normal, sample, workflow_run
with workflow_run(seed=0):
draws = sample(Normal("x", 3.0, 1.0), sample_shape=1000)
print("ProbPipe version:", probpipe.__version__)
print("number of draws:", draws.shape[0])
print("mean of the draws:", round(float(jnp.mean(draws.raw)), 2))
print("standard deviation of the draws:", round(float(jnp.std(draws.raw)), 2))
It prints:
ProbPipe version: 0.2.0.dev0
number of draws: 1000
mean of the draws: 3.0
standard deviation of the draws: 1.0
Next steps¶
- The quickstart fits a first model, checks it, and forecasts with it in about ten minutes.
- The first tutorial begins an analysis of a moose population that the tutorials follow from a first model to forecasts with uncertainty.
Human-validated by Jonathan Huggins on 2026-10-25.