3

i'm trying to get pystan to work on Windows 10 in order to use the fbprophet package for time series. I have already installed MinGW, added its directories to my PATH environment variable and tried this piece of code to verify everything is working fine:

gcc -dumpversion
ld -v
dllwrap -version

which yields these results:

C:\WINDOWS\system32>gcc -dumpversion
6.3.0

C:\WINDOWS\system32>ld -v
GNU ld (GNU Binutils) 2.28

C:\WINDOWS\system32>dllwrap -version
GNU dllwrap (GNU Binutils) 2.28
Copyright (C) 2017 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

everything iw working fine to this point.

The problems comes when once in python, i try to execute the following code:

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)
y = model.sampling(n_jobs > 1).extract()['y']
y.mean()  # with luck the result will be near 0

for which i'm getting this output:

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)
y = model.sampling(n_jobs > 1).extract()['y']
y.mean()  # with luck the result will be near 0
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_5944b02c79788fa0db5b3a93728ca2bf NOW.
Traceback (most recent call last):

  File "<ipython-input-3-941feb69c4c4>", line 3, in <module>
    model = pystan.StanModel(model_code=model_code)

  File "Z:\Anaconda3\lib\site-packages\pystan\model.py", line 313, in __init__
    build_extension.run()

  File "Z:\Anaconda3\lib\distutils\command\build_ext.py", line 339, in run
    self.build_extensions()

  File "Z:\Anaconda3\lib\distutils\command\build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()

  File "Z:\Anaconda3\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)

  File "Z:\Anaconda3\lib\distutils\command\build_ext.py", line 533, in build_extension
    depends=ext.depends)

  File "Z:\Anaconda3\lib\distutils\ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)

  File "Z:\Anaconda3\lib\distutils\cygwinccompiler.py", line 175, in _compile
    raise CompileError(msg)

CompileError: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1

I have searched on the website prior to posting this question, as well as in other websites, but nothing seems to work for me. I'd appreciate any help.

Thanks in advance

Miguel 2488
  • 1,410
  • 1
  • 20
  • 41

0 Answers0