Installing RStan on Windows 10 64bit...Error

We had a similar issue with Windows 7. Oddly enough, the installation of RStan was not problematic on some laptops yet failed on others despite very similar environments (Windows 7, R 3.5.1, RStudio 1.1.453, Rtools 3.4.0.1962) with a similar message as the original post in this thread (‘C:/Program’ not found).

R was installed to the default directory c:/Program files/R. The laptops on which everything worked fine showed 8dot3 shortnames (so for instance C:\PROGRA~1\R) when the command dir /x was executed in a DOS prompt at c:/. In other cases this was missing.

The following workaround was successful:

  • open a DOS terminal
  • Type: mklink /J "C:\PROGRA~1" "C:\Program Files" and press enter (this will create a directory junction from C:\PROGRA~1 to C:\Program Files, which will be visible in the windows explorer) (see also this link)
  • Open RStudio
  • Go to Tools - Global Options and click Change R-version in the General tab.
  • Click “Choose a specific version of R” and click on browse.
  • Copy paste C:\PROGRA~1\R in the destination folder. Click further to the map containing your most recent R version (R-x.y.z).
  • In the screen that pops up choose 64-bits R version (or 32-bits)
  • Click Apply and restart Rstudio

After that, RStan and brms worked fine (after install.packages(“rstan”)).

I hope someone points this to the root cause of the problem… maybe @bgoodri? I guess it has nothing to do with rstan, but rather the interaction between Rstudio and Rtools?

1 Like