PyStan import error in a (seemingly) successful installation

I tried to install PyStan on a Mac (OS Catalina) desktop using pip3, installation seems to work, but whe trying to import it I get ModuleNotFoundError: No module named 'pystan'.
it seems unrelated to this thread here on discourse, which seems to be a Windows problem, but I also found a similar error that is fixed by pip-installing “pystan<3” instead, which works. Is this expected?

What python do you use?

What python installation pip3 is referring?

Try this (but replace python with correct call → python3?)

python -m pip install pystan

1 Like

The most recent versions of pystan (>= 3) use stan instead of pystan in the import statement, whereas in earlier versions it was just pystan.

If you try import stan after installation, it should hopefully work.

2 Likes

Yes, that’s what was happening, I hand’t used pystan in a while, and wasn’t expecting a name change was the issue (and finding an unsolved issue in a google search misled me into thinking it was something nontrivial).