Windows RStan installation issues (Sys.which("make") gives nothing & Error in prep_call_sampler(object))

Dear Stan folks,

I tried to install the rstan package on the new machine. I first downloaded Rtools 40 and installed the rstan package with RStudio. The issue is that it seems Rtools40 does not find the path. Second is that when I tried the example code, the error message appears. I paste my code and error messages. Could anyone help me, please?

Sys.which(“make”)
make
“”

install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)
library(rstan)
example(stan_model,run.dontrun = TRUE)

Error in prep_call_sampler(object) :
could not find function “prep_call_sampler”
In addition: Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
‘-E’ not found

Thanks!

Hi,

did you run

writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")

after installing RTools? See instructions here: https://cran.r-project.org/bin/windows/Rtools/#putting-rtools-on-the-path

Try this, restart the R ression and try again.

Hi @rok_cesnovar,
Yes, I ran that line. Still, the output is a blank.

After rebooting the machine, it works all fine. It’s weird why it did not work when I even restarted the R session. Thanks!

1 Like