# PyStan + Anaconda installation instructions

**URL:** <https://discourse.mc-stan.org/t/pystan-anaconda-installation-instructions/1557>\
**Category:** PyStan\
**Created:** [August 14, 2017, 6:56am UTC](https://discourse.mc-stan.org/t/pystan-anaconda-installation-instructions/1557 "2017-08-14T06:56:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![avehtari](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/avehtari/32/5935_2.png) [@avehtari](https://discourse.mc-stan.org/u/avehtari)\
**Post date:** [August 14, 2017, 6:56am UTC](https://discourse.mc-stan.org/t/pystan-anaconda-installation-instructions/1557/1 "2017-08-14T06:56:43Z")

</div>

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)  
and  
`pip install pystan` (installing PyStan 2.16)  
worked just fine for me.

Aki

---

<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:** [August 14, 2017, 10:17am UTC](https://discourse.mc-stan.org/t/pystan-anaconda-installation-instructions/1557/2 "2017-08-14T10:17:53Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![avehtari](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/avehtari/32/5935_2.png) [@avehtari](https://discourse.mc-stan.org/u/avehtari)\
**Post date:** [August 14, 2017, 10:34am UTC](https://discourse.mc-stan.org/t/pystan-anaconda-installation-instructions/1557/3 "2017-08-14T10:34:13Z")

</div>

> [@ahartikainen](#):
>
> ps. I do not recommend using Anaconda, instead use conda virtual environment.

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

Aki

---

<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:** [August 14, 2017, 10:36am UTC](https://discourse.mc-stan.org/t/pystan-anaconda-installation-instructions/1557/4 "2017-08-14T10:36:19Z")

</div>

> [@avehtari](#):
>
> 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

```

---

<div class="post-metadata">

**Author:** ![olivier-ma](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/olivier-ma/32/1023_2.png) [@olivier-ma](https://discourse.mc-stan.org/u/olivier-ma)\
**Post date:** [September 30, 2017, 12:36am UTC](https://discourse.mc-stan.org/t/pystan-anaconda-installation-instructions/1557/5 "2017-09-30T00:36:44Z")

</div>

> 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.

---

<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:** [September 30, 2017, 4:38am UTC](https://discourse.mc-stan.org/t/pystan-anaconda-installation-instructions/1557/6 "2017-09-30T04:38:11Z")

</div>

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
