Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 35 additions & 15 deletions docs/source/installation.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,45 @@
(installation)=
# Installation

We recommend using [Anaconda](https://www.anaconda.com/) (or [Miniforge](https://github.com/conda-forge/miniforge)) to install Python on your local machine, which allows for packages to be installed using its `conda` utility.
As of PyMC v6, PyMC compiles models with the [Numba](https://numba.pydata.org/) backend by
default, so no extra system setup (compiler or BLAS) is required, and PyMC can
be installed with `pip`.

Once you have installed one of the above, PyMC can be installed into a new conda environment as follows:
We also recommend installing [nutpie](https://github.com/pymc-devs/nutpie), a
fast NUTS sampler written in Rust. When nutpie is installed, PyMC selects it as
the default NUTS sampler automatically — typically about 2x faster than PyMC's
built-in NUTS:

```console
conda create -c conda-forge -n pymc_env "pymc>=5"
pip install "pymc[nutpie]"
```

To install PyMC on its own:

```console
pip install pymc
```

## Installing with conda

As an alternative, PyMC can be installed with `conda` using
[Anaconda](https://www.anaconda.com/) or
[Miniforge](https://github.com/conda-forge/miniforge). We recommend a fresh
conda environment:

```console
conda create -c conda-forge -n pymc_env pymc
conda activate pymc_env
```

If you like, replace the name `pymc_env` with whatever environment name you prefer.

To enable nutpie when using conda:

```console
conda install -c conda-forge nutpie
```

:::{seealso}
The [conda-forge tips & tricks](https://conda-forge.org/docs/user/tipsandtricks.html#using-multiple-channels) page to avoid installation
issues when using multiple conda channels (e.g. defaults and conda-forge).
Expand All @@ -22,20 +51,11 @@ If you wish to enable sampling using the JAX backend via NumPyro,
you need to install it manually as it is an optional dependency:

```console
conda install numpyro
```

Similarly, to use BlackJAX sampler instead:

```console
conda install blackjax
pip install numpyro
```

## Nutpie sampling

You can also enable sampling with [nutpie](https://github.com/pymc-devs/nutpie).
Nutpie uses numba as the compiler and a sampler written in Rust for faster performance.
Similarly, to use the BlackJAX sampler instead:

```console
conda install -c conda-forge nutpie
pip install blackjax
```