Skip to content

Installation Guide (MacOS)

Christian Luhmann edited this page May 12, 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 python=3.9 pymc
conda activate pymc_env

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

PyMC v3 installation

Alternatively, the latest release of PyMC3 can be installed from Conda Forge (conda-forge):

If you are running on the new M1 chip

conda create -c conda-forge -n pymc3_env python=3.9 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=3.9 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.

Installing the Development branch

The current development branch of PyMC can be installed from GitHub, also using pip:

pip install git+https://github.com/pymc-devs/pymc

Make sure to install the Theano-PyMC version that is pegged in PyMC3's requirements.txt. For more information, see the Theano-PyMC installation section, below.

Installing from a Git Clone

Lastly, another option is to clone the repository and install PyMC:

git clone https://github.com/pymc-devs/pymc
cd pymc3
python setup.py install (or python setup.py develop)

Theano-PyMC Installation

PyMC requires Theano-PyMC instead of Theano.

  • If you have Theano installed, please remove it and install Theano-PyMC via Conda Forge:
conda remove theano
  • If you have an outdated version of Theano-PyMC, then re-install the module via Conda Forge:
conda remove theano-pymc -y
conda install -c conda-forge theano-pymc -y
  • If you have cloned PyMC3's repository onto your computer, you can install Theano-PyMC using the requirements.txt:
pip install -r requirements.txt