8000 Python pystan package is not working in Windows 11 · Issue #1052 · winpython/winpython · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Python pystan package is not working in Windows 11  #1052
Open
@Dushyant-Singh-Rajput

Description

@Dushyant-Singh-Rajput

HI I am trying to execute the below code and getting error every tim 66C2 e

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code) # this will take a minute
y = model.sampling(n_jobs=1).extract()['y']
y.mean()

INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_5944b02c79788fa0db5b3a93728ca2bf NOW.

DistutilsExecError Traceback (most recent call last)
~\anaconda3\lib\site-packages\setuptools_distutils\cygwinccompiler.py in _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts)
164 try:
--> 165 self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
166 extra_postargs)

~\anaconda3\lib\site-packages\setuptools_distutils\ccompiler.py in spawn(self, cmd, **kwargs)
916 def spawn(self, cmd, **kwargs):
--> 917 spawn(cmd, dry_run=self.dry_run, **kwargs)
918

~\anaconda3\lib\site-packages\setuptools_distutils\spawn.py in spawn(cmd, search_path, verbose, dry_run, env)
67 cmd = cmd[0]
---> 68 raise DistutilsExecError(
69 "command %r failed with exit code %s" % (cmd, exitcode))

DistutilsExecError: command 'C:\Users\Dushyant Singh\anaconda3\Library\mingw-w64\bin\gcc.exe' failed with exit code 1

During handling of the above exception, another exception occurred:

CompileError Traceback (most recent call last)
in
1 import pystan
2 model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
----> 3 model = pystan.StanModel(model_code=model_code) # this will take a minute
4 y = model.sampling(n_jobs=1).extract()['y']
5 y.mean()

~\anaconda3\lib\site-packages\pystan\model.py in init(self, file, charset, model_name, model_code, stanc_ret, include_paths, boost_lib, eigen_lib, verbose, obfuscate_model_name, extra_compile_args, allow_undefined, include_dirs, includes)
376
377 try:
--> 378 build_extension.run()
379 finally:
380 if redirect_stderr:

~\anaconda3\lib\site-packages\setuptools_distutils\command\build_ext.py in run(self)
337
338 # Now actually compile and link everything.
--> 339 self.build_extensions()
340
341 def check_extensions_list(self, extensions):

~\anaconda3\lib\site-packages\setuptools_distutils\command\build_ext.py in build_extensions(self)
446 self._build_extensions_parallel()
447 else:
--> 448 self._build_extensions_serial()
449
450 def _build_extensions_parallel(self):

~\anaconda3\lib\site-packages\setuptools_distutils\command\build_ext.py in _build_extensions_serial(self)
471 for ext in self.extensions:
472 with self._filter_build_errors(ext):
--> 473 self.build_extension(ext)
474
475 @contextlib.contextmanager

~\anaconda3\lib\site-packages\setuptools_distutils\command\build_ext.py in build_extension(self, ext)
526 macros.append((undef,))
527
--> 528 objects = self.compiler.compile(sources,
529 output_dir=self.build_temp,
530 macros=macros,

~\anaconda3\lib\site-packages\setuptools_distutils\ccompiler.py in compile(self, sources, output_dir, macros, include_dirs, debug, extra_preargs, extra_postargs, depends)
572 except KeyError:
573 continue
--> 574 self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
575
576 # Return all object filenames, not just the ones we just built.

~\anaconda3\lib\site-packages\setuptools_distutils\cygwinccompiler.py in _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts)
166 extra_postargs)
167 except DistutilsExecError as msg:
--> 168 raise CompileError(msg)
169
170 def link(self, target_desc, objects, output_filename, output_dir=None,

CompileError: command 'C:\Users\Dushyant Singh\anaconda3\Library\mingw-w64\bin\gcc.exe' failed with exit code 1

As per the available suggestions , I have already installed ming-w64 and also updated the
"C:\Users\Dushyant Singh\anaconda3\lib\site-packages\setuptools_distutils\distutils.cfg" with below values
[build]
compiler=mingw32

Every time is providing me the same compiler error .

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0