Skip to content

Installation Guide (Windows)

Jed Ludlow edited this page Jun 3, 2022 · 49 revisions

PyMC Installation on Windows

The following instructions rely on having Anaconda, Mamba or Miniforge installed, which provide Python environments from which you can install and run PyMC in a controlled way, using the conda utility.

Simple Install

The Simple Install process for PyMC under Windows is recommended for most users, with conda being used to set up an environment that contains required dependencies, including the GCC compiler toolchain. Using conda allows Aesara and PyMC to easily access MKL and also confines the install of the GCC compiler toolchain into the conda environment rather than placing it onto the global Windows PATH.

It is usually a good idea to install into a fresh conda environment, which we will call pymc_env:

conda create -n pymc_env -c conda-forge pymc libpython mkl-service numba m2w64-toolchain

Next, you can activate the environment in which you just installed PyMC.

conda activate pymc_env

You might experience this warning message when running PyMC:

WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

If so, create a file called .aesararc, and put it in your home directory (usually C:\Users\<username>). Add these lines to .aesararc:

[blas]
ldflags = -lblas

That will signal Aesara to link against BLAS, and that should eliminate the warning message.

Fancy Install

The Fancy Install of PyMC is for those who would prefer to manage the GCC compiler installation on their own rather than rely on conda to do it. You can install an up-to-date copy of GCC yourself and make sure it is available on the global Windows PATH. An easy way to do this (though not the only way) is via the Chocolatey package manager:

choco install mingw

Once GCC installation has completed, you can then pickup the creation of a conda environment as described above, replacing the conda environment creation command with this one, which omits the m2w64-toolchain:

conda create -n pymc_env -c conda-forge pymc libpython mkl-service numba

JAX sampling

JAX is not directly supported on Windows systems at the moment.