Windows 11: Could not locate an R installation on the system

I updated R and R Studio to newest version. Since then RStudio throws the error: Could not locate an R installation on the system. However, if I press Ctrl at startup then RStudio offers me to use R 4.6.0.

  • I tried deinstalling and installing R and RStudio several times,
  • I delete/renamed the %localapp%\RStudio directories, and
  • I can start R 4.6. from the terminal

but nothing helped. Any other ideas what I could do?

Thanks a lot Sigbert

Does it help when you configure RStudio to use a specific R version instead of your system's default ( Tools > Global Options > General > R version > Choose specific version)?

And do you know if R 4.6 installer did update registry with a new current R version and location? You could check HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R for this and/or just run RSetReg.exe from installation location (e.g. C:\Program Files\R\R-4.6.0\bin\x64 ) to add or update those registry entries ( R for Windows FAQ : Does R use the Registry?).

I personally prefer rig for managing R installations, also makes it easy to quickly switch default R version or just start RStudio with a specific R version.

  1. Choosing a specific R version did not help.
  2. Running RSetReg.exe did not help.
  3. Installing the new RStudio did not help.

Any other ideas?

Thanks for the report! We've filed this as an RStudio issue so it can be tracked: "Could not locate an R installation" is shown when R was found but failed to start; registry paths are read with ANSI APIs · Issue #19499 · rstudio/rstudio · GitHub

A fix is already in progress; feel free to follow along or add details there.