# Help with issues starting pymc3 (problems with theano?)

**URL:** https://discourse.pymc.io/t/help-with-issues-starting-pymc3-problems-with-theano/3386
**Category:** Questions
**Tags:** theano
**Created:** [June 6, 2019, 8:11pm UTC](https://discourse.pymc.io/t/help-with-issues-starting-pymc3-problems-with-theano/3386 "2019-06-06T20:11:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![abhicherath](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/abhicherath/32/1975_2.png) [@abhicherath](https://discourse.pymc.io/u/abhicherath)
#### Post date: [June 6, 2019, 8:11pm UTC](https://discourse.pymc.io/t/help-with-issues-starting-pymc3-problems-with-theano/3386/1 "2019-06-06T20:11:13Z")

</div>

```
WARNING (theano.configdefaults): Only clang++ is supported. With g++, we end up with strange g++/OSX bugs.
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
Traceback (most recent call last):

  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 81, in <module>
You can find the C code in this temporary file: /var/folders/6p/s1lmbd2d1yv0tsqz41x6j9t00000gn/T/theano_compilation_error_q4izdyxt
actual_version, force_compile, _need_reload))
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/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 105, in <module>
actual_version, force_compile, _need_reload))
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/abhishek/Library/Preferences/PyCharmCE2019.1/scratches/scratch.py", line 3, in <module>
import pymc3 as pm
  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/pymc3/ __init__.py", line 5, in <module>
from .distributions import *
  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/pymc3/distributions/ __init__.py", line 1, in <module>
from . import timeseries
  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/pymc3/distributions/timeseries.py", line 1, in <module>
import theano.tensor as tt
  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/theano/ __init__.py", line 110, in <module>
from theano.compile import (
  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/theano/compile/ __init__.py", line 12, in <module>
from theano.compile.mode import *
  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/theano/compile/mode.py", line 11, in <module>
import theano.gof.vm
  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/theano/gof/vm.py", line 674, in <module>
from . import lazylinker_c
  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 140, in <module>
preargs=args)
  File "/Users/abhishek/PycharmProjects/Neutron_Spectrum_Unfold/venv/lib/python3.7/site-packages/theano/gof/cmodule.py", line 2396, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): In file included from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/7.1.0/include-fixed/syslimits.h:7:0,. from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/7.1.0/include-fixed/limits.h:34,. from /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:11,. from /Users/abhishek/.theano/compiledir_Darwin-18.6.0-x86_64-i386-64bit-i386-3.7.0-64/lazylinker_ext/mod.cpp:1:. /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/7.1.0/include-fixed/limits.h:194:15: fatal error: limits.h: No such file or directory. #include_next <limits.h> /* recurse down to the real one */. ^ ~~~~~~~~~. compilation terminated.. 

```

I’m on MacOS Mojave. This is the code I’m trying to run.

```
import numpy as np
import pymc3 as pm
import matplotlib.pyplot as plt

obs_y = np.random.normal(0.5,0.35,2000)

with pm.Model() as exercise1:

    stdev = pm.HalfNormal('stdev', sd=.05)
    mu = pm.Normal('mu', mu=0.0, sd = .05)

    y = pm.Normal('y', mu = mu, sd = stdev, observed =obs_y)

    trace = pm.sample(1000)

    pm.traceplot(trace, ['mu','stdev'])
    plt.show()

```

What’s wrong exactly here? Is there anything I’ve to install? Also how can I change theano config files? Thank you for your time!

Abhishek Cherath

---

<div class="post-metadata">

### Author: ![sharsenij14](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sharsenij14](https://discourse.pymc.io/u/sharsenij14)
#### Post date: [June 7, 2019, 1:31am UTC](https://discourse.pymc.io/t/help-with-issues-starting-pymc3-problems-with-theano/3386/2 "2019-06-07T01:31:04Z")

</div>

Hey, your code runs fine on my machine, so it is probably a package version / installation issue. This is what I have in my environment:

theano 1.0.4  
numpy 1.16.4  
pymc3 3.7  
python 3.7.3

---

<div class="post-metadata">

### Author: ![sharsenij14](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sharsenij14](https://discourse.pymc.io/u/sharsenij14)
#### Post date: [June 7, 2019, 1:51am UTC](https://discourse.pymc.io/t/help-with-issues-starting-pymc3-problems-with-theano/3386/3 "2019-06-07T01:51:14Z")

</div>

I did some digging, I think the issue is specific to OSX Mojave (I am still running High Sierra). Check [https://github.com/openai/mujoco-py/issues/331](https://github.com/openai/mujoco-py/issues/331). There are a few solutions offered there.

---

<div class="post-metadata">

### Author: ![abhicherath](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/abhicherath/32/1975_2.png) [@abhicherath](https://discourse.pymc.io/u/abhicherath)
#### Post date: [June 7, 2019, 1:51am UTC](https://discourse.pymc.io/t/help-with-issues-starting-pymc3-problems-with-theano/3386/4 "2019-06-07T01:51:41Z")

</div>

Thank you!

---

<div class="post-metadata">

### Author: ![abhicherath](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/abhicherath/32/1975_2.png) [@abhicherath](https://discourse.pymc.io/u/abhicherath)
#### Post date: [June 7, 2019, 2:03am UTC](https://discourse.pymc.io/t/help-with-issues-starting-pymc3-problems-with-theano/3386/5 "2019-06-07T02:03:24Z")

</div>

The issue is fixed, the problem was that I didn’t have command line tools installed. so I did `xcode-select --install` in terminal and now it works.
