Module 'stan' has no attribute 'StanModel'

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. I did my work in Jupyter notebook.
when running the code, the following error appears.

Can any one suggest a solution?

Thanks a lot in advance.

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

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