Switching To Using Stan With Python On Windows, Which Interface To Use?

I’m new to stan but I’ve used the rstan package a few times, but I want to switch to python so i can better intergrate with other programs and packages.

Looking at the documentation, it looks like you have to install WSL2 and a linux distro to use pystan which is a bit intimidating haha. It looks like you don’t have to do this for CMDstanpy but there’s less information about so I’m not sure how user friendly it is.

Which one would the community recommend? And what significant differences can i expect from them?

If you are willing to use WSL2 (with which VS Code and PyCharm both work well on Windows, I’d recommend unless you’re committed to something particular), you can use pystan or CmdStanPy. I find CmdStanPy easier in the long run since it boils down to just a bunch of files, making it easier to instrument should the need arise (maybe a pystan3 dev could point to its advantages).

If you don’t use WSL2, then following CmdStan instructions for Windows but pointing CmdStanPy to the CmdStan install, then you can avoid WSL2 without problems.

1 Like

I laid out some of the differences here: CmdStanPy 1.0 - #3 by WardBrian

If you are comfortable with WSL, I suspect using it will be better than not, no matter which you go with. If not, you essentially must use CmdStanPy. Installation should be fairly straightforward if you walk through the steps, or it can be done in one command if you are a conda user.

2 Likes