Skip to content

Installation Guide (Windows)

Chris Fonnesbeck edited this page Apr 20, 2022 · 49 revisions

PyMC Installation on Windows

The following instructions rely on having Anaconda or Miniforge (preferred) installed, which provide Python environments from which you can install and run PyMC in a controlled way.

Prior to installing PyMC, also ensure that you have C/C++ compilers installed on your system. If you have Visual Studio already installed then you likely already have these. Otherwise, installing a recent version of MinGW (11.2.0 or greater) will provide the necessary compilers. An easy way to do this (though not the only way) is via the Chocolatey package manager:

choco install mingw

Then, installing PyMC under Windows is a two-step process, with conda being used to set up an environment and then pip to install PyMC itself. Using conda allows Aesara and PyMC to easily access MKL.

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 python libpython mkl-service numba python-graphviz scipy arviz

Next, PyMC can be installed into the environment we have created:

conda activate pymc_env
pip install pymc --pre

Until v4 is officially released, you will need to add the --pre flag as shown to get the correct version. If you are looking for PyMC3, then replace the above with pip install pymc3.

Note that if you are updating a previous version of PyMC, you may need to remove Theano and install Theano-PyMC before updating:

conda remove theano
conda install -c conda-forge theano-pymc