Skip to content

Installation Guide (MacOS)

Chris Fonnesbeck edited this page Jan 14, 2021 · 44 revisions

PyMC3 installation on MacOS

We recommend using Anaconda to install Python3 on MacOS, which allows for packages like PyMC3 to be installed using its conda utility. If you are running MacOS on Apple M1 hardware, you will instead need to install Python with Miniforge, as Anaconda does not yet support this new hardware.

The latest release of PyMC3 can be installed from Conda-Forge:

conda install -c conda-forge pymc3

or, using Miniforge, since it uses Conda-Forge as its default repository:

conda install pymc3

While strongly discouraged due to installation problems you could try to install PyMC3 and its dependencies via PyPI using pip:

pip install pymc3

The reason installation via PyPI is difficult, especially on Windows and OSX, is that Theano requires compilation against MKL, which is difficult to set up, while Conda comes with its own compilers and MKL installation.

Note that running pip install pymc will install PyMC 2.3, not PyMC3, from PyPI.

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

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

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.

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

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

Theano-PyMC Installation

PyMC3 is tested on Python 3.6, 3.7, and 3.8 and depends on NumPy, SciPy, and pandas (see requirements.txt for version information).

Moreover, as of late 2020, PyMC3 now 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

Arviz Installation

Plots and diagnostics are entirely done by ArviZ - if you follow the installation instructions above, then it will be installed alongside PyMC3.

Optional

In addtion to the above dependencies, the GLM submodule relies on Patsy.