CompileError: even after successfully installing pystan

you could try CmdStanPy. CmdStanPy 1.0