Installation issue of mkl-service for PyMC3 on Apple M1-chip

Hi there,

I’m using one of the new Apple laptops with an M1-chip and I’m trying to install on it PyMC3. I’m following the instructions from the website and simply using conda create -c conda-forge -n pymc3_env python=3.9 pymc3. However, whenever I import pymc3, I get the following warning:

import pymc3 as pm

WARNING (theano.link.c.cmodule): install mkl with `conda install mkl-service`: No module named 'mkl'

If I then try to do some sampling, I get the same warning all over again:

with pm.Model() as model:
...     θ = pm.Beta("θ", alpha=1, beta=1)
...     idata = pm.sample(1000, return_inferencedata=True)
...
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Multiprocess sampling (4 chains in 4 jobs)
NUTS: [θ]
WARNING (theano.link.c.cmodule): install mkl with `conda install mkl-service`: No module named 'mkl'
WARNING (theano.link.c.cmodule): install mkl with `conda install mkl-service`: No module named 'mkl'
WARNING (theano.link.c.cmodule): install mkl with `conda install mkl-service`: No module named 'mkl'
WARNING (theano.link.c.cmodule): install mkl with `conda install mkl-service`: No module named 'mkl'

I tried to do conda install mkl-service but it does not work:

> conda install mkl-service

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - mkl-service

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-arm64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/osx-arm64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-arm64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

My conda settings are:

> conda info

     active environment : base
    active env location : /Users/roberto/miniconda3
            shell level : 1
       user config file : /Users/roberto/.condarc
 populated config files : /Users/roberto/.condarc
          conda version : 4.11.0
    conda-build version : not installed
         python version : 3.8.12.final.0
       virtual packages : __osx=12.1=0
                          __unix=0=0
                          __archspec=1=arm64
       base environment : /Users/roberto/miniconda3  (writable)
      conda av data dir : /Users/roberto/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-arm64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-arm64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/roberto/miniconda3/pkgs
                          /Users/roberto/.conda/pkgs
       envs directories : /Users/roberto/miniconda3/envs
                          /Users/roberto/.conda/envs
               platform : osx-arm64
             user-agent : conda/4.11.0 requests/2.26.0 CPython/3.8.12 Darwin/21.2.0 OSX/12.1
                UID:GID : 501:20
             netrc file : None
           offline mode : False

Not sure if I’m missing something, but any help is appreciated.

1 Like

Same problem …

Actually not a problem. MKL is a BLAS implementation optimized for intel chips, which this isn’t. The warning is just confusing and has been removed in current versions of aesara. So you can just keep using PyMC3 without any problems and ignore the warning until you upgrade.

1 Like

Thanks for the clarification @twiecki !

1 Like