# Module 'stan' has no attribute 'StanModel'

**URL:** <https://discourse.mc-stan.org/t/module-stan-has-no-attribute-stanmodel/30872>\
**Category:** General\
**Tags:** fitting-issues\
**Created:** [March 26, 2023, 9:11pm UTC](https://discourse.mc-stan.org/t/module-stan-has-no-attribute-stanmodel/30872 "2023-03-26T21:11:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meqdad\_Hasan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/meqdad_hasan/32/16114_2.png) [@Meqdad\_Hasan](https://discourse.mc-stan.org/u/Meqdad_Hasan)\
**Post date:** [March 26, 2023, 9:11pm UTC](https://discourse.mc-stan.org/t/module-stan-has-no-attribute-stanmodel/30872/1 "2023-03-26T21:11:44Z")

</div>

hello guys.

I am using ubuntu 20.04, with python installed on a virtual environment python 3.11. and pystan version 3.6.0.

I am learning to use pystan. So I tried the code on [this website](https://www.takayabe.net/post/pystan-bsts). I did my work in Jupyter notebook.  
when running the code, the following error appears.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/3X/7/3/7367f27592cb9fcf132f9fddf759014b3d1b86f8.png)

Can any one suggest a solution?

Thanks a lot in advance.

---

<div class="post-metadata">

**Author:** ![WardBrian](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/wardbrian/32/12078_2.png) [@WardBrian](https://discourse.mc-stan.org/u/WardBrian)\
**Post date:** [March 26, 2023, 11:52pm UTC](https://discourse.mc-stan.org/t/module-stan-has-no-attribute-stanmodel/30872/2 "2023-03-26T23:52:06Z")

</div>

That code appears to be based on PyStan2, which is no longer supported

---

<div class="post-metadata">

**Author:** ![Meqdad\_Hasan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/meqdad_hasan/32/16114_2.png) [@Meqdad\_Hasan](https://discourse.mc-stan.org/u/Meqdad_Hasan)\
**Post date:** [October 5, 2023, 9:19pm UTC](https://discourse.mc-stan.org/t/module-stan-has-no-attribute-stanmodel/30872/3 "2023-10-05T21:19:10Z")

</div>

Thank you.  
noted. I changed it and it works.
