Skip to content

Installation Guide (MacOS)

rpgoldman edited this page Dec 30, 2021 · 44 revisions

PyMC v3 installation on MacOS

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

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

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

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

PyMC v4 Installation on MacOS

Until a release version of PyMC v4 is available, it must be installed directly from the repository itself:

git clone https://github.com/pymc-devs/pymc/
cd pymc
conda env create -f ./conda-envs/environment-dev-py39.yml
conda activate pymc-test-py39
pip install .