# Theano problems in macOS Catalina

**URL:** <https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050>\
**Category:** Questions\
**Created:** [October 30, 2019, 3:09pm UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050 "2019-10-30T15:09:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![drbenvincent](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/drbenvincent/32/4313_2.png) [@drbenvincent](https://discourse.pymc.io/u/drbenvincent)\
**Post date:** [October 30, 2019, 3:09pm UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050/1 "2019-10-30T15:09:14Z")

</div>

I upgraded to macOS Catalina and now I’m having a problem PyMC3 issues with theano.

```auto
Exception: Compilation failed (return status=1): In file included from /Users/benjamv/.theano/compiledir_Darwin-19.0.0-x86_64-i386-64bit-i386-3.7.5-64/lazylinker_ext/mod.cpp:1:. In file included from /Users/benjamv/opt/anaconda3/include/python3.7m/Python.h:25:. /Users/benjamv/opt/anaconda3/bin/../include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found. #include_next <stdio.h>. ^ ~~~~~~~~. 1 error generated.. 

```

I previous had this problem under macOS Mojave but was solvable (eg [Help with issues starting pymc3 (problems with theano?)](https://discourse.pymc.io/t/help-with-issues-starting-pymc3-problems-with-theano/3386)).But this solution does not work with Catalina. Best I can find is this question [https://stackoverflow.com/questions/58278260/cant-compile-a-c-program-on-a-mac-after-upgrading-to-catalina-10-15/58278392#58278392](https://stackoverflow.com/questions/58278260/cant-compile-a-c-program-on-a-mac-after-upgrading-to-catalina-10-15/58278392#58278392) Problem is I can’t follow it. It’s not entirely clear what I needs to be done to fix the problem.

Hoping someone can help me out.

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [October 31, 2019, 1:54pm UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050/2 "2019-10-31T13:54:07Z")

</div>

I dont have a mac to test it out, did you do all the usually steps of updating also Xcode, accept licence etc?  
@fonnesbeck said he’s on Catalina and does not have problem upgrading - Chris how did you do the upgrade?

---

<div class="post-metadata">

**Author:** ![fonnesbeck](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/fonnesbeck/32/13_2.png) [@fonnesbeck](https://discourse.pymc.io/u/fonnesbeck)\
**Post date:** [October 31, 2019, 2:37pm UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050/3 "2019-10-31T14:37:32Z")

</div>

Definitely make sure you update your Xcode command line tools, and toss out your `~/.theano` folder for good measure. Worked with no issues on a new MBP.

---

<div class="post-metadata">

**Author:** ![drbenvincent](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/drbenvincent/32/4313_2.png) [@drbenvincent](https://discourse.pymc.io/u/drbenvincent)\
**Post date:** [November 2, 2019, 5:42pm UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050/4 "2019-11-02T17:42:41Z")

</div>

I already had the Command Line Tools. But I deleted them from `/Library/Developer/CommandLineTools/` and reinstalled with `xcode-select --install`.  
I deleted `~/.theano`. I made sure I am up to date with:

```
conda update --all
conda install -c conda-forge pymc3

```

Still no luck, I get the same theano related error when importing PyMC3.

To be honest I’ve had theano related errors after almost every single slight Mac OS update. It’s been a real headache.

I’ll download the full Xcode rather than just the Command Line Tools and see if that does anything.

EDIT: after restarting the terminal I can import pymc3 without error, but I get basically the same error when trying to build a model with PyMC

EDIT 2: I reinstalled Anaconda (which still fails to add Python to the path). I only randomly encountered the Xcode agreement thing by typing `Python3` which I never do (I use ipython or jupyter notebooks). But even after having reinstalled, done the Xcode agreement, still no luck. (Seems that you can manually do the agreement with `sudo xcodebuild -license`)

EDIT 3: Installed full Xcode and opened it up to let it do its thing. Still no luck. Out of ideas at this point.

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [November 4, 2019, 11:11am UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050/5 "2019-11-04T11:11:10Z")

</div>

I just upgrade to Catalina - reinstall conda (using miniconda) and does not see any problem. Also I opt in to use zsh instead of the default bash and thus reset all the path in .zshrc - not sure if it helps in your situation or not.

---

<div class="post-metadata">

**Author:** ![drbenvincent](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/drbenvincent/32/4313_2.png) [@drbenvincent](https://discourse.pymc.io/u/drbenvincent)\
**Post date:** [November 5, 2019, 6:46pm UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050/6 "2019-11-05T18:46:42Z")

</div>

Updating the path in .zshrc allowed me to open ipython, Jupiter lab etc. But still getting same compilation error with theano. Will do some more searching, but it’s becoming quite dispiriting. I appreciate the help though

---

<div class="post-metadata">

**Author:** ![drbenvincent](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/drbenvincent/32/4313_2.png) [@drbenvincent](https://discourse.pymc.io/u/drbenvincent)\
**Post date:** [November 5, 2019, 7:07pm UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050/7 "2019-11-05T19:07:38Z")

</div>

Ok. Looks like it’s working after this [https://stackoverflow.com/a/58323411/5172570](https://stackoverflow.com/a/58323411/5172570)

---

<div class="post-metadata">

**Author:** ![drbenvincent](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/drbenvincent/32/4313_2.png) [@drbenvincent](https://discourse.pymc.io/u/drbenvincent)\
**Post date:** [February 20, 2020, 10:38am UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050/8 "2020-02-20T10:38:37Z")

</div>

UPDATE: I had the same problem again after a minor MacOS update. I tried the same fix and it didn’t work for whatever reason. Eventually after a big headache, things seemed to get fixed using this answer [https://stackoverflow.com/a/58349403](https://stackoverflow.com/a/58349403) from the same stackoverflow page as above

---

<div class="post-metadata">

**Author:** ![sammosummo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/sammosummo/32/96_2.png) [@sammosummo](https://discourse.pymc.io/u/sammosummo)\
**Post date:** [March 3, 2020, 2:34pm UTC](https://discourse.pymc.io/t/theano-problems-in-macos-catalina/4050/9 "2020-03-03T14:34:55Z")

</div>

I just encountered the same issue. Thanks for posting the solution.
