Error from Running Stan (cmdstanr) after installation

Hi, Please I am trying get Stan to work on my desktop using

“install.packages(“cmdstanr”, repos = c(❗ This repository is deprecated and no longer updated | r-packages, getOption(“repos”))) library(cmdstanr) check_cmdstan_toolchain() # checks compiler/toolchain cmdstanr::check_cmdstan_toolchain() cmdstanr::check_cmdstan_toolchain(fix = TRUE) cmdstanr::install_cmdstan() library(cmdstanr) ##Test mod ← cmdstan_model(write_stan_file(" data { real y_mean; } parameters { real y; } model { y ~ normal(y_mean, 1); } ")) fit ← mod$sample(data = list(y_mean = 0)) fit$summary() ”

Once I am done installing, I get “The C++ tool chain required for CmdStan is setup properly!” Upon running a model,

I get this very weird error message below: “INFO: Could not find files for the given pattern(s).C:/Users/xxxx /.cmdstan/cmdstan-2.36.0/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbb:28: CONFIG: cfg=release arch=CScript Error: Execution of the Windows Script Host failed. (This program is blocked by group policy. For more information, contact your system administrator. ) compiler=gcc target=windows runtime=CScript Error: Execution of the Windows Script Host failed. (This program is blocked by group policy. For more information, contact your system administrator. ) ” I tried reaching out to IT help desk thinking that it might be blocked by them since they set up the system.

However, IT has not be able to provide a solution. Please could anyone tell me what I can do to get Stan (cmdstanr) to work on my desktop. I need to use my desktop.

Not a CmdStanR user myself, but I take that you are following the instructions on the CmdStanR page, and maybe for someone used to the R environment it is more readable, but to me it looks quite tarballed.

I would think you’d get some messages for each of the installation commands that maybe hints at what is missing (maybe it’s just a warning during installation that later catches up to the actual functionality). Where does this one come up exactly?

Also, since you have to install CmdStan (not CmdStanR) anyway, maybe you can try installing that from command line and seeing if that is working as expected.

Many thanks.
Yes each of the installing commands have no errors and I am following the installation on the CmdStanR.

The error comes up when I actual want to run a model to test the installation.

I am not sure why the error

“INFO: Could not find files for the given pattern(s).C:/Users/xxxx /.cmdstan/cmdstan-2.36.0/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbb:28: CONFIG: cfg=release arch=CScript Error: Execution of the Windows Script Host failed. (This program is blocked by group policy. For more information, contact your system administrator. )”

This error can occur when you’re using a university or corporate system that blocks running arbitrary executables, as cmdstan models are compiled to an executable and then run.

If your IT department doesn’t allow this kind of behaviour, you’ll be restricted to using rstan unfortunately

1 Like

Dear Andrew,
Many thanks. this was the interpretation that I had too so I called the IT unit in my school to check it. Upon checking it, they noticed that they are not the ones blocking it. So, they requested that I get across to stan or on github or something that could be blocked by them. I am not sure why. This is working on my small laptop, but I need to sue my desktop which is better but I cannot run my models after installing stan

Best wishes,
Christabel