Can't run pystan on WIndows

I have been following the instructions on pystan’s website here to install pystan on windows 10. I follow the instructions line by line - I set up a new environment, install mingw-w64 compiler toolchain, add a .cfg file to the folder as instructed, install dependencies and finally pystan.

When I run the sample model as instructed python gives this error:

INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_5944b02c79788fa0db5b3a93728ca2bf NOW.
Traceback (most recent call last):
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\”, line 267, in link
self.spawn(linker + ld_args)
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\”, line 987, in spawn
spawn(cmd, dry_run=self.dry_run, **kwargs)
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\”, line 70, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command ‘C:\Users\xxx\anaconda3\Library\mingw-w64\bin\g++.exe’ failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\xxx\anaconda3\lib\site-packages\pystan\”, line 378, in init
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\command\”, line 346, in run
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\command\”, line 466, in build_extensions
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\command\”, line 492, in _build_extensions_serial
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\command\”, line 571, in build_extension
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\”, line 751, in link_shared_object
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\”, line 260, in link
File “C:\Users\xxx\anaconda3\lib\site-packages\setuptools_distutils\”, line 269, in link
raise LinkError(msg)
distutils.errors.LinkError: command ‘C:\Users\xxx\anaconda3\Library\mingw-w64\bin\g++.exe’ failed with exit code 1

I have checked the forum for similar issues. Following their advice I double checked on the .cfg file and it is in the correct folder with the content as instructed by the website. The issue persists.
I suspect the problem is related to c++ compiler but I don’t know where to go from here. Please help!

These GCC mingw errors are hard and pystan is not tested with the latest python versions.

Have you tried CmdStanPy (+ArviZ)