Installing pymc3 on MacOS Big Sur

I recently got a new computer and am attempting to install pymc3 on my new machine. My computer is running Mac OS Big Sur 11.2.3.

I have attempted to follow all of the different recommendations and instructions provided here to successfully install pymc3. I’ve tried to do this using anaconda and that results in the following error given below. Additionally, I’ve tried instead installing it via pip install git+https://github.com/pymc-devs/pymc3 and get the error (ERROR: Command errored out with exit status 1: git clone -q GitHub - pymc-devs/pymc3: Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Aesara /private/tmp/pip-req-build-deziwhha Check the logs for full command output.). I’ve even tried specifying which version of pymc3 to download, but that doesn’t seem to result in me successfully downloading pymc3, since afterwards, I’m unable to load it in python. Any help would be greatly appreciated!


You can find the C code in this temporary file: /var/folders/yf/fgkf_qmj1slcrvy38bhy5lmr0000gn/T/theano_compilation_error_xm60cn45
Traceback (most recent call last):
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/gof/lazylinker_c.py”, line 76, in
raise ImportError(
ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/gof/lazylinker_c.py”, line 99, in
raise ImportError(
ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 1, in
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/pymc3/init.py”, line 39, in
__set_compiler_flags()
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/pymc3/init.py”, line 33, in __set_compiler_flags
import theano
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/init.py”, line 78, in
from theano import scalar, tensor
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/scalar/init.py”, line 1, in
from .basic import *
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/scalar/basic.py”, line 24, in
from theano import config, gof, printing
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/printing.py”, line 19, in
from theano.compile import Function, SharedVariable, debugmode
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/compile/init.py”, line 1, in
from theano.compile.debugmode import DebugMode
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/compile/debugmode.py”, line 27, in
from theano.compile.mode import Mode, register_mode
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/compile/mode.py”, line 10, in
import theano.gof.vm
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/gof/vm.py”, line 697, in
from . import lazylinker_c
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/gof/lazylinker_c.py”, line 139, in
cmodule.GCC_compiler.compile_str(dirname, code, location=loc, preargs=args)
File “/Users/jessegolden-marx/anaconda3/lib/python3.8/site-packages/theano/gof/cmodule.py”, line 2556, in compile_str
raise Exception(
Exception: Compilation failed (return status=1): In file included from /Users/jessegolden-marx/.theano/compiledir_macOS-10.16-x86_64-i386-64bit-i386-3.8.5-64/lazylinker_ext/mod.cpp:1:. In file included from /Users/jessegolden-marx/anaconda3/include/python3.8/Python.h:25:. /Users/jessegolden-marx/anaconda3/bin/…/include/c++/v1/stdio.h:107:15: fatal error: ‘stdio.h’ file not found. #include_next <stdio.h>. ^~~~~~~~~. 1 error generated…

There’s some discussion here about how to solve this problem.

Thanks for sharing this. While I tried following these steps and installed xcode on my machine, the new version of Mac OS Big Sur doesn’t have a /usr/local/include folder. I’m not familiar with how to generate such a folder (since I get permission denied when I try to) or what the correct workaround would be. So, any advice on this (or other approaches to this installation problem) would be greatly appreciated.