Skip to content

Installation Guide (MacOS)

Thomas Wiecki edited this page Jun 10, 2022 · 44 revisions

PyMC Installation on MacOS

We recommend using Anaconda (or Miniforge) to install Python on MacOS, which allows for packages to be installed using its conda utility.

conda create -c conda-forge -n pymc_env "pymc>=4.0"
conda activate pymc_env

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

JAX sampling

If you wish to enable sampling using the JAX backend via NumPyro (experimental), the following should also be installed:

pip install jax jaxlib numpyro

Similarly, to use BlackJAX for sampling it should be installed via pip:

pip install blackjax

PyMC v3 installation

If you are looking for PyMC3, then replace the above with

conda create -c conda-forge -n pymc3_env pymc3
conda activate pymc3_env

For older (Intel) Macs, you can should also install the Intel Math Kernel Library (MKL) for improved speed:

conda create -c conda-forge -n pymc3_env python pymc3 theano-pymc mkl mkl-service
conda activate pymc3_env

Note that you must specifically request theano-pymc or you will get an obsolete version of PyMC3 that works with the now-abandoned theano library. We encourage you to test this with the --dry-run flag to ensure you get up-to-date versions.