PyStan + Anaconda installation instructions

It would be good to add to the PyStan installation instructions, that after installing Anaconda from the installation package, it’s recommended to run
conda update --all
Without this Anaconda 4.4.0 (released in May 31) + Ubuntu 16.04, gives a cryptic error.
After this both
conda install pystan (installing PyStan 2.14)
pip install pystan (installing PyStan 2.16)
worked just fine for me.


Anaconda finally updated their libgcc to 5.2.

This problem originates from the incompatible ABI between gcc 4.x and <5.2. The default gcc compiler for Ubuntu is >5.2. This is fine and everything works.
Then one installs Anaconda, which comes without gcc, but it has libgcc installed(numba or some other package needs it). libgcc comes with libstdc++ which is used if any C++ code is compiled with Anaconda. libgcc used to be 4.8 which meant that one could compile C++ code, but could not import anything compiled.

Now if one updates their libgcc this problem goes away.

conda update libgcc 

ps. I do not recommend using Anaconda, instead use conda virtual environment. It is clean and easy to maintain. One can even install R /R-studio in conda-env (channel r or conda-forge).

conda create -n stan_env python=3.6 numpy cython pandas matplotlib scipy pystan jupyter notebook
source activate stan_env
# to list conda environments
conda-env list

Is there some other conda than the one which is part of Anaconda or Miniconda?


No. It is the same. I usually only download miniconda. If one needs Anaconda:

conda install Anaconda

Anaconda finally updated their libgcc to 5.2.

Is this system specific? libgcc on Mac is still 4.8.5, and I’m getting a long list of warnings when compiling stan file.

And like @avehtari mentioned, conda installs PyStan 2.14, so probably shouldn’t included pystan in the installed list if you want the latest version.

It might be. I have not tested.

If it is only warnings, then no need to worry about it. It is normal.

Adding -c conda-forge to the installation line should give you the latest PyStan release (on unix and osx, have to fix this for Windows).

OT. On windows one needs M2W64 toolchain + libpython

1 Like