# Compilation error in Pystan (macOS Mojave)

**URL:** <https://discourse.mc-stan.org/t/compilation-error-in-pystan-macos-mojave/6383>\
**Category:** PyStan\
**Created:** [November 6, 2018, 6:10pm UTC](https://discourse.mc-stan.org/t/compilation-error-in-pystan-macos-mojave/6383 "2018-11-06T18:10:43Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ahartikainen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ahartikainen/32/321_2.png) [@ahartikainen](https://discourse.mc-stan.org/u/ahartikainen)\
**Post date:** [November 6, 2018, 6:51pm UTC](https://discourse.mc-stan.org/t/compilation-error-in-pystan-macos-mojave/6383/3 "2018-11-06T18:51:05Z")

</div>

Hi,

First, use pip version `pip install pystan` and try compiling again.

There seems to be similar problems with mojave

> <https://github.com/cython/cython/issues/2694>

  

> <https://github.com/pandas-dev/pandas/issues/23424>

Run this (in pandas issue) and try again:

/Library/Developer/CommandLineTools/Packages/macOS\_SDK\_headers\_for\_macOS\_10.14.pkg

If that doesn’t work, then remove xcode and commandline tools and do the fresh install.

Run all these tests in fresh conda-env.

Install PyStan from source to a new conda env.

```
conda create -n stan_env python=3.7 numpy cython
conda activate stan_env

```

Then install from source (needs git, install with conda if not found; `conda install git`)

```
pip install git+https://github.com/stan-dev/pystan

```

---

_[View the full topic](https://discourse.mc-stan.org/t/compilation-error-in-pystan-macos-mojave/6383)._
