RStudio cannot find Rtools

[This question is similar to: Rtools not recognized on Win 10, R 3.6.1, RStudio 1.2.5001, but I couldn't find a solution there.]

I'm using R studio version 1.1.442, and a recent installation of R 3.6.3 (2020-02-29), on Windows 7, Platform: x86_64-w64-mingw32/x64.

I also installed Rtools 3.5. Yet, every time I try to build/install a local package I get:

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/

I've done all the relevant tests I can find, and none point to any problems on my system. At least pkgbuild can find Rtools. Why can't Rstudio??? Is this a bug of R studio 1.1.442 or one related to R 3.6.3?

> pkgbuild::find_rtools()
[1] TRUE
> pkgbuild::find_rtools(debug=TRUE)
Scanning R CMD config CC...
cc_path: c:/Rtools/mingw_64/bin/gcc 
install_path: c:/Rtools 
Found compatible gcc from R CMD config CC
[1] TRUE
> pkgbuild::rtools_path()
[1] "c:/Rtools/bin"

1 Like

Did you add Rtools folder into your PATH environment variable ?
It could help. BINPREF can also be useful.
I add some issues in the past with that

The finding mechanism are not the same I think. One is inside the package, the other is inside RStudio and it seems they are not identical.

In RStudio on windows, I often use pkgbuild::with_build_tools() to run safely being sure RTools is found.

Which RStudio version are you using ?
I think there are still issue on this opened on RStudio side.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

Yes, Rtools is on my PATH, and just after R. Normally the Rtools installer package does all of this. I never heard of BINPREF before, but will check it out.

A short version of my question is why pkgbuild can find Rtools, but Rstudio cannot.

> Sys.getenv("PATH")
[1] "C:\\R\\R-3.6.3\\bin\\x64;C:\\Rtools\\bin;C:\\Program Files\\ImageMagick-7.0.9-Q16;c:\\Rtools\\mingw_32\\bin;c:\\Rtools\\gcc-4.6.3\\bin;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Perl64\\site\\bin;C:\\Perl64\\bin;c:\\Rtools\\gcc-4.6.3\\bin;C:\\Program Files\\ImageMagick-6.8.1-Q16;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;
...
> 
> pkgbuild::has_build_tools()
[1] TRUE

Sys.setenv(BINPREF = "C:/Rtools/mingw_64/bin/") doesn't help