install.packages() tells me that Rtools is not installed, but has_rtools() is able to find Rtools in the default folder

Hi,

I am having trouble understanding what is happening with my Rtools installation.
I have R4.3.0 and Rtools 4.2 is installed in the recommended folder [C:/rtools42].

However, everytime I run an install.packages() command, I get the following warning message:

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

Yet, when I run has_rtools(), R can find Rtools:

library(pkgbuild)
has_rtools(debug = TRUE)
#Found in Rtools 4.2 installation folder
#[1] TRUE

Any idea how I could solve this issue? Many thanks in advance :slight_smile:

try installing Rtools 4.3?

Thanks @mikecrobp, but Rtools 4.3 is apparently not compatible with R4.3.0. I tried to uninstall Rtools 4.2 and install Rtools 4.3, but then I got a message stating stat Rtools 4.3 was not compatible with my version of R [R4.3.0].

I have R 4.3.0 and Rtools 4.3. On Windows.
I did have to explicitly select which R would be used by RStudio.
Sorry - can't help beyond that

Thanks @mikecrobp
It somehow seems weird to me how R 4.3.0 and Rtools 4.2/4.3 interact:

  • when I install Rtools 4.3 and uninstall Rtools 4.2, I get the following message:
library(pkgbuild)
has_rtools(debug = TRUE)
# WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 4.3.0
# was found. (Only the following incompatible version(s) of Rtools were found: 4.3.5550)
# Please download and install Rtools 4.2

but install.packages() works fine:

install.packages("ggplot2")
# Installing package into...
  • when I install Rtools 4.2 and uninstall Rtools 4.3, I get the following message:
library(pkgbuild)
has_rtools(debug = TRUE)
# Found in Rtools 4.2 installation folder
# [1] TRUE

install.packages("ggplot2")
# WARNING: Rtools is required to build R packages but is not currently installed.
# Please download and install the appropriate version of Rtools before proceeding:
  • when I install both Rtools 4.2 and Rtools 4.3, everything runs smoothly:
library(pkgbuild)
has_rtools(debug = TRUE)
# Found in Rtools 4.2 installation folder
# [1] TRUE

install.packages("ggplot2")
# Installing package into...

But I guess, I will just keep Rtools 4.3 and ignore the warning message from has_rtools().

I just checked. I hadn't removed Rtools 4.2 either. So maybe there is an interaction between the 2 versions (or something left out in 4.3). I am not going to experiment though!

1 Like

This topic was automatically closed 7 days after the last reply. 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.