Skip to content

Installation Guide (Windows)

Michael Osthege edited this page Jun 10, 2021 · 49 revisions

PyMC3 Installation on Windows

The essence of a solid PyMC3 installation on Windows is to install most of the dependencies through conda. The reason installation via PyPI is difficult is that Theano/Aesara require compilation against MKL, which is difficult to set up, while Conda comes with its own compilers and MKL installation.

⚠ Do not pip install without first installing dependencies with conda. ⚠

⚠ Getting BLAS installation right is quite tricky. If the steps below don't work also check out this thread. ⚠

# starting out with a fresh environment
conda create -c msys2 -c conda-forge -n mypm3env python=3.8 mkl-service libpython m2w64-toolchain scipy matplotlib pandas
conda activate mypm3env

# or with an existing one
conda install mkl-service libpython m2w64-toolchain scipy

After that, PyMC3 can be installed with

pip install pymc3

or

conda install -c conda-forge pymc3

Developer Installation

If you want to tinker with PyMC3 itself, first clone the repository and then make an "editable" installation:

git clone https://github.com/pymc-devs/pymc3/
cd pymc3
pip install --editable .

Upgrading from Theano to Theano-PyMC

If you have the original Theano installed, please remove it and install Theano-PyMC via Conda Forge:

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

Optional Dependencies

  • The GLM submodule relies on Patsy.
  • pm.model_to_graphviz depends on Graphviz and pydot:
    • conda install -c conda-forge python-graphviz
    • pip install pydot-ng
Clone this wiki locally