select rtools path

Can I control the directoy RStudio looks for rtools in?

When I open Rstudio, my system path is not correctly reflected in the RStudio sys path. Possibly for this reason I get the warning

In Power Shell: notice: ;;D:\Program Files\rtools43\bin

$env:Path
C:\Python311\Scripts\;C:\Python311\;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files\Python310\Scripts\;C:\Program Files\Python310\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Wolfram Research\WolframScript\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;D:\Program Files\rtools43\bin;C:\Users\hnelson3\AppData\Local\Microsoft\WindowsApps;
PS C:\Users\hnelson3>

But in Rstudio notice it is trying to use: c:/rtools42/x86_64-w64-mingw32.static.posix/bin;c:/rtools42/usr/bin;D:\\Program Files\\R-4.2.2\\bin\\x64;

Sys.getenv("PATH")
[1] "C:\\Python311\\Scripts;C:\\Python311;c:/rtools42/x86_64-w64-mingw32.static.posix/bin;c:/rtools42/usr/bin;D:\\Program Files\\R-4.2.2\\bin\\x64;C:\\Python311\\Scripts\\;C:\\Python311\\;C:\\Program Files\\Microsoft MPI\\Bin\\;C:\\Program Files\\Python310\\Scripts\\;C:\\Program Files\\Python310\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\Wolfram Research\\WolframScript\\;C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\Microsoft SQL Server\\160\\DTS\\Binn\\;C:\\Program Files\\Azure Data Studio\\bin;C:\\Program Files (x86)\\Microsoft SQL Server\\160\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\160\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\160\\DTS\\Binn\\;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\Program Files\\nodejs\\;C:\\ProgramData\\chocolatey\\bin;D:\\Program Files\\rtools43\\bin;C:\\Users\\hnelson3\\AppData\\Local\\Microsoft\\WindowsApps;;D:/Program Files/RStudio/resources/app/bin/quarto/bin"

Is the Rtools path included in the registry?

What did you do, e.g. what code did you run to trigger this? What was the full output?

The two commands I use are listed in my post: env:Path in powershell and Sys.getenv("PATH") in R. So I'm not sure what you are asking for. I included the complete output.

I assume that rtools is not working, that is why you are posting on this forum. How did you try to use it, and what was the output?

To test, I create a new "package" project, then without any modifications, I try to "Build".

In this case the "Build" message is

==> Rcmd.exe INSTALL --preclean --no-multiarch --with-keep.source test

* installing to library 'C:/Users/hnelson3/AppData/Local/R/win-library/4.2'
* installing *source* package 'test' ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (test)
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/




Of course I also do not want to install to the C:/ drive but will try to fix that later.

Is the Rtools path included in the registry?

What does pkgbuild::find_rtools() say?

pkgbuild::find_rtools()
WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 4.2.2 was found. (Only the following incompatible version(s) of Rtools were found: 4.3)

Please download and install Rtools 4.2 from https://cran.r-project.org/bin/windows/Rtools/ or https://www.r-project.org/nosvn/winutf8/ucrt3/.
> 

Is the Rtools path included in the registry?

Yes it is, Software -> R-core -> Rtools -> 4.3.
Install path D:\Program Files\rtools43
FullVersion 4.3.0.1

It seems like your R version needs Rtools 4.2, not 4.3.

1 Like

Thanks. Congratulations, you are more useful thanchat.openai.com/chat Now I just have to figure out how to get the builds to go to D: instead of C:.

==> Rcmd.exe INSTALL --preclean --no-multiarch --with-keep.source test

* installing to library 'C:/Users/hnelson3/AppData/Local/R/win-library/4.2'

This is because it is a virtual machine and the C: drive is very limited. I guess every virtual machine on this system has to share the C: drive for critical OS stuff, not my R package libraries.

Set the R_LIBS_USER env var, see ?R_LIBS_USER.

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.