Pystan causes crash (gcc compiler?), conda on Mac OS X

After initial learning bump, conda is quite pleasent to use. (basically you have independent directories that contain all python stuff, and calling source activate envname /(or newer conda installations give you option to call conda activate envname) will make the envfolder the main (updates $PATH for bin and python folders).

To see all the environments, you can use conda env list.

We also have python interface to CmdStan called CmdStanPy https://cmdstanpy.readthedocs.io/en/latest/

And ArviZ supports both CmdStan/CmdStanPy too, so you can do visualizations and diagnostics with it, if you want.

https://arviz-devs.github.io/arviz/index.html

But I don’t think your PyStan is failing due your Python setup.

The problem is with your compiler and this error should also manifest itself with CmdStan too.

So, I think you should try to fix the header issue with the macOS compiler.

See the following resources

Make sure you have opened Xcode once via Spotlight to accept its license
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

install that so it puts C++ headers back in /usr/include

xcode-select --install