Install pystan - no conda


I’m currently facing the following error message when trying to import pystan:

ImportError                               Traceback (most recent call last)
<ipython-input-1-763403f05525> in <module>
      1 import numpy as np
      2 import pandas as pd
----> 3 import pystan as ps
      4 import arviz as az

~\AppData\Roaming\Python\Python37\site-packages\pystan\ in <module>
      7 import logging
----> 9 from pystan.api import stanc, stan
     10 from pystan.misc import read_rdump, stan_rdump, stansummary
     11 from pystan.diagnostics import check_hmc_diagnostics

~\AppData\Roaming\Python\Python37\site-packages\pystan\ in <module>
     11 import os
---> 13 import pystan._api  # stanc wrapper
     14 from pystan._compat import string_types, PY2
     15 from pystan.model import StanModel

ImportError: DLL load failed: The specified module could not be found.

I’m sure other packages using “mingw64” or “C++” don’t show any error messages. I see some user use conda. However, I’m wondering whether there is a way to install pystan without using conda.

Currently, it is really hard. You would probably need to manually fix some compiler flags and set up clang-cl interface (+edit distutils class to accept clang-cl)

1 Like