After updating to brms 2.13.3 and rstan 2.21.1, I have found that I am no longer able to run models using “brm” command. When I run the code, it begins with “Compiling Stan program…” and then ceases running. There are no error messages accompanying this.
Here is an easy code to run:
n = 100
Var1 = sample(c(0,1),n,replace=TRUE)
value = sample(c(0,1),n,replace=TRUE)
df <- data.frame(value = value, Var1 = Var1)
m1 <- brm(value ~ Var1, data = df)
My computer specs are:
Operating System: Windows 10
R version 4.0.2
Rstudio version 1.3.959
brms version 2.13.3
I actually installed Rtools just today, so that should be fine. It might be relevant to note that this Windows computer I am using is new, and I have previously only used R on Apple products, so it is possible that I am missing something important (permissions or similar problems). However, I have noticed no other issues with R except this problem with running the model.
@julianquandt, I can’t speak for @Limulus, but I was having the same issue (also having just installed brms and rtools on a new machine) and this worked for me! Thanks for the link.
In addition: Warning message:
In file.remove(c(unprocessed, processed)) :
cannot remove file ‘C:\Users\danie\AppData\Local\Temp\RtmpCqQWMk\file32c42763515.stan’, reason ‘No such file or directory’
I believe the error goes much deeper, and I am thinking about simply uninstalling R and reinstalling to try to rebuild it.
I am facing this issue after downloading R v 4.0 to my new laptop. I tried the troubleshooting suggested by @bgoodri in the last message in this thread. Got this error:
package ‘rstan’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘rstan’
Warning in install.packages :
problem copying C:\Users\Dr.Meghana\Documents\R\win-library\4.0\00LOCK\rstan\libs\x64\rstan.dll to C:\Users\Dr.Meghana\Documents\R\win-library\4.0\rstan\libs\x64\rstan.dll: Permission denied
Warning in install.packages :
restored ‘rstan’
None of the other suggestions seem to work for me. Any help will be much appreciated.
and if that doesn’t work, manually delete the folder C:\Users\Dr.Meghana\Documents\R\win-library\4.0\rstan using Windows Explorer. Then, in a clean R session, try installing rstan again.
Writing with an update. I had managed to get brms up and running after following your instructions. However, today the same problem has reappeared. This time, the troubleshooting tips in this thread did not work for me. What worked for me was to install an older version of brms (v2.13.0).
I have this exact same problem. Brms just stops after ‘Compiling Stan program…’.
I am running Windows 7, R version is 4.0.2, RTools version is 4.0 (its path contains no spaces), brms version is 2.13.5, and rstan version is 2.21.2. RStudio version is 1.3.1073.
And unlike meghs, I do not know how to manually install an earlier version of brms to fix this.
UPDATE: I figured out how to install older versions of packages. Going back to version 2.13.0 of brms did not help. Neither did reverting to brms 2.12.0. I also tried downgrading R itself from 4.0.2 to 3.6.3 (the last version where everything still worked) and RTools to 3.5.0, all of which availed me naught. Now brms just will not work, no matter what I do. Once the model is (presumably) compiled and sampling is due to start, brms just aborts without any warning or error message.
There are almost 400 lines of cryptic messages. The final error message is:
Error in file(con, "r") : cannot open the connection
In addition: Warning messages:
1: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
'C:/rtools40/usr/mingw_/bin/g++' not found
2: In file(con, "r") :
cannot open file 'file126827444826.cpp.err.txt': No such file or directory
Skipping install of 'inline' from a github remote, the SHA1 (f80c7f99) has not changed since last install.
Use `force = TRUE` to force installation
I ran the same command with force = TRUE, then called require(inline) before trying to fit the model again. It continues to crash at the same stage, but now it also produces textual output: