# Dependencies pymc3 v3.0rc2

**URL:** <https://discourse.pymc.io/t/dependencies-pymc3-v3-0rc2/13195>\
**Category:** v3\
**Tags:** installation\
**Created:** [October 29, 2023, 11:38am UTC](https://discourse.pymc.io/t/dependencies-pymc3-v3-0rc2/13195 "2023-10-29T11:38:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_julian](https://avatars.discourse-cdn.com/v4/letter/_/ecd19e/32.png) [@\_julian](https://discourse.pymc.io/u/_julian)\
**Post date:** [October 29, 2023, 11:38am UTC](https://discourse.pymc.io/t/dependencies-pymc3-v3-0rc2/13195/1 "2023-10-29T11:38:38Z")

</div>

Hi,

I’m trying to install pymc3 v3.0rc2 on Python v2.7 with Anaconda.  
Since it is a pain to solve all the dependencies with Anaconda, I wanted to ask if somebody knows the dependencies for this pymc3 version.

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![ricardoV94](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ricardov94/32/5775_2.png) [@ricardoV94](https://discourse.pymc.io/u/ricardoV94)\
**Post date:** [October 29, 2023, 7:06pm UTC](https://discourse.pymc.io/t/dependencies-pymc3-v3-0rc2/13195/2 "2023-10-29T19:06:57Z")

</div>

Hey @_julian, I don’t have immediate advice. Just wanted to ask, out of curiosity, why do you want to install these specific pymc3/ python 2.7 versions?

---

<div class="post-metadata">

**Author:** ![jessegrabowski](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/jessegrabowski/32/5010_2.png) [@jessegrabowski](https://discourse.pymc.io/u/jessegrabowski)\
**Post date:** [October 29, 2023, 7:31pm UTC](https://discourse.pymc.io/t/dependencies-pymc3-v3-0rc2/13195/3 "2023-10-29T19:31:07Z")

</div>

The [test environments used in v3](https://github.com/pymc-devs/pymc/tree/v3/conda-envs) are probably a good place to start. But I don’t think PyMC3 was tested on Python v2, so it might not work at all.

---

<div class="post-metadata">

**Author:** ![\_julian](https://avatars.discourse-cdn.com/v4/letter/_/ecd19e/32.png) [@\_julian](https://discourse.pymc.io/u/_julian)\
**Post date:** [October 29, 2023, 9:00pm UTC](https://discourse.pymc.io/t/dependencies-pymc3-v3-0rc2/13195/4 "2023-10-29T21:00:53Z")

</div>

@jessegrabowski thanks for that hint!

> [@ricardoV94](#):
>
> Hey @_julian, I don’t have immediate advice. Just wanted to ask, out of curiosity, why do you want to install these specific pymc3/ python 2.7 versions?

In fact I found some pymc3 code in a jupyter notebook and I am trying to reproduce it:

```python
import numpy as np
import pandas as pd
import datetime as dt
from pandas_datareader import data as DataReader
import yfinance as yf
yf.pdr_override()
import matplotlib.pyplot as plt
%matplotlib inline
  
np.random.seed(1000000) #Who wants to be a millionaire
  
start, end = dt.datetime(2014, 1, 1), dt.datetime(2015, 12, 31)
sp500 = DataReader.get_data_yahoo('^GSPC', start, end).loc[:,'Close']
  
returns = np.log(sp500[1:] / sp500[0:-1].values) # Calculate log returns
train, test = np.arange(0, 450), np.arange(451,len(returns))
n=len(train)

plt.plot(returns)

import pymc3 as pm
with pm.Model() as model:
    sigma = pm.Exponential('sigma', 1./.02, testval=.1)
    mu = pm.Normal('mu', 0, sd=5, testval=.1)
  
    nu = pm.Exponential('nu', 1./10)
    logs = pm.GaussianRandomWalk('logs', tau=sigma**-2, shape=n)
  
    #lam uses variance in pymc3, not sd like in scipy
    r = pm.StudentT('r', nu, mu=mu, lam=1/pm.exp(-2*logs), observed=returns.values[train]) 

```

I somehow managed to install pymc3.0r2 because the code dates from 2016 and I thought this would thus maybe be the right version, but I am still getting the error that the function `pm.exp()` does not exist. Also, the general result of this version is not the same as in the notebook.  
I don’t know if there is some doc where I could find the version in which the function `exp()` does exist in pymc3?

---

<div class="post-metadata">

**Author:** ![jessegrabowski](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/jessegrabowski/32/5010_2.png) [@jessegrabowski](https://discourse.pymc.io/u/jessegrabowski)\
**Post date:** [October 29, 2023, 9:57pm UTC](https://discourse.pymc.io/t/dependencies-pymc3-v3-0rc2/13195/5 "2023-10-29T21:57:00Z")

</div>

At a quick glance, this code should run fine on the latest version. Instead of debugging stuff on the old version, you should give this a try on the new version and see what errors you get.

The only obvious things I see are that you will need to change the `testval` argument to `initval`, and `import pymc as pm` instetad of `pmyc3`.

---

<div class="post-metadata">

**Author:** ![twiecki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/twiecki/32/6930_2.png) [@twiecki](https://discourse.pymc.io/u/twiecki)\
**Post date:** [October 29, 2023, 11:47pm UTC](https://discourse.pymc.io/t/dependencies-pymc3-v3-0rc2/13195/6 "2023-10-29T23:47:20Z")

</div>

See here for a port to PyMC 5 of this model: [Stochastic Volatility model — PyMC example gallery](https://www.pymc.io/projects/examples/en/latest/case_studies/stochastic_volatility.html)
