I have no idea why RStudio has such kind of problems from time to time but there is a manual work-around described here:

https://github.com/rwinlib/r-base/wiki/Testing-Packages-with-Experimental-R-Devel-Build-for-Windows

Basically you have to set two environment variables to point to the correct installation path of Rtools:

Sys.setenv(PATH = paste("C:/Rtools/bin", Sys.getenv("PATH"), sep=";"))
Sys.setenv(BINPREF = "C:/Rtools/mingw_$(WIN)/bin/")

Ensure that for the BINPREF path, the final slash is included after bin.

To avoid losing this change after restarting RStudio you could modify your (Windows) environment variables instead or add the following rows to your .Renviron file that is executed at each startup of R.

BTW: The $(WIN) part is no typo but required so that R can inject "32" or "64" depending on the R version you are using (32 or 64 bit).

Edit 1: See also this r-bloggers article published recently: https://www.r-bloggers.com/quirks-about-running-rcpp-on-windows-through-rstudio/

Answer from R Yoda on Stack Overflow
🌐
Reddit
reddit.com › r/rstats › rtools isn't recognized by r
r/rstats on Reddit: Rtools isn't recognized by R
May 28, 2021 -

Hi. I updated R recently and everything turned in a mess. Somehow R (nor Rstudio) don't find Rtools but devtools keeps saying that Rtools is in effect installed.

I checked my Path variables several times with no luck. As far as I know, Sys.which("make") points to the correct location but Sys.which("gcc") fails. I tried using the instruction Sys.setevn to point BINPREF properly with no luck too.

Any tips or advice? I run out of ideas checking SE and Rstudio community

Edit: Currently working on a Win 10, with R 4.1.0

Edit 2: already reinstalled Rtools+R with no results. Also Path was updated to point to rtools40/usr/bin as Rtools (windows) help suggest

Edit 3: [SOLVED] Thanks everyone, but none of the solutions works. I decided to use a killer approach (clean installation of windows) and it worked.

Top answer
1 of 5
34

I have no idea why RStudio has such kind of problems from time to time but there is a manual work-around described here:

https://github.com/rwinlib/r-base/wiki/Testing-Packages-with-Experimental-R-Devel-Build-for-Windows

Basically you have to set two environment variables to point to the correct installation path of Rtools:

Sys.setenv(PATH = paste("C:/Rtools/bin", Sys.getenv("PATH"), sep=";"))
Sys.setenv(BINPREF = "C:/Rtools/mingw_$(WIN)/bin/")

Ensure that for the BINPREF path, the final slash is included after bin.

To avoid losing this change after restarting RStudio you could modify your (Windows) environment variables instead or add the following rows to your .Renviron file that is executed at each startup of R.

BTW: The $(WIN) part is no typo but required so that R can inject "32" or "64" depending on the R version you are using (32 or 64 bit).

Edit 1: See also this r-bloggers article published recently: https://www.r-bloggers.com/quirks-about-running-rcpp-on-windows-through-rstudio/

2 of 5
3

Note that there are new potential kinds of problems (from R 3.3 onwards), since R (not RStudio, but R) adds a BINPREF variable and modifies the Path variable by default, see the Renviron.site file for the latter, on Windows typically e.g. under C:\Program Files\R\R-3.4.3\etc:

PATH="C:\Rtools\bin;${PATH}" 

This might easily conflict for people with a custom path and/or multiple versions of Rtools installed, so I have commented this out with a #.

For the BINPREF problem, see the Makeconf file, e.g. under C:\Program Files\R\R-3.4.3\etc\x64:

BINPREF ?= c:/Rtools/mingw_64/bin/

I have then modified this to c:/Rtools34/mingw_64/bin/, which is where I have installed my Rtools34.
You can do the same for the Makeconf file under the 32-bit arch. sub-directory.

Discussions

Rtools not recognized even when it is installed
But still the following message pops-up every time while installing a package · WARNING: Rtools is required to build R packages but is not currently installed. More on github.com
🌐 github.com
9
October 29, 2020
Rtools not found after R 4.0.0 installation
After installing R 4.0.0, I got a message that Rtools was out of date. I installed the new version of Rtools and now get the message: WARNING: Rtools is required to build R packages but is not currently installed. I tried setting the path as suggested as a previous fix (Sys.setenv(PATH = ... More on forum.posit.co
🌐 forum.posit.co
1
0
April 27, 2020
Warning that I need to install Rtools when I already have it installed
Howdy! I am trying to install rstan on a computer with Windows 10 that is very troublesome due to lots of clamped down security. I have R 4.3.0 and Rtools 4.3 installed. I can only install binaries from a http CRAN repository on this machine. I seem to have successfully installed the new rstan ... More on discourse.mc-stan.org
🌐 discourse.mc-stan.org
14
0
September 12, 2023
Help wanted: Trouble installing and loading packages. Rtools isn’t in my version of R?
You’re out of luck. Ask IT to update R and/or to install RTools for your version of R. Alternatively, ask them how you are supposed to install R packages. More on reddit.com
🌐 r/Rlanguage
5
9
March 28, 2023
🌐
GitHub
github.com › rstudio › rstudio › issues › 3563
RStudio do not find Rtools and offer to install even if already installed · Issue #3563 · rstudio/rstudio
September 30, 2018 - System details RStudio Edition : Desktop RStudio Version : 1.2.1013 OS Version : Windows 10 R Version : 3.5.1 Steps to reproduce the problem On a windows machine with R 3.5.1, install Rtools in C:/Rbuildtools. This is the path by default...
Author   rstudio
🌐
GitHub
github.com › rstudio › rstudio › issues › 8221
Rtools not recognized even when it is installed · Issue #8221 · rstudio/rstudio
October 29, 2020 - But still the following message pops-up every time while installing a package · WARNING: Rtools is required to build R packages but is not currently installed.
Author   rstudio
🌐
R Project
cran.r-project.org › bin › windows › Rtools › rtools40.html
Using Rtools4 on Windows
You can do this with a text editor, or from R like so (note that in R code you need to escape backslashes): write('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', file = "~/.Renviron", append = TRUE) Restart R, and verify that make can be found, which should show the path to your Rtools installation.
🌐
Stan Forums
discourse.mc-stan.org › interfaces › rstan
Warning that I need to install Rtools when I already have it installed - RStan - The Stan Forums
September 12, 2023 - Howdy! I am trying to install rstan on a computer with Windows 10 that is very troublesome due to lots of clamped down security. I have R 4.3.0 and Rtools 4.3 installed. I can only install binaries from a http CRAN repository on this machine. I seem to have successfully installed the new rstan 2.26 from CRAN, but when I ran the example model, I got the following warnings: WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 4.3.0 was found.
Find elsewhere
🌐
Reddit
reddit.com › r/rlanguage › help wanted: trouble installing and loading packages. rtools isn’t in my version of r?
r/Rlanguage on Reddit: Help wanted: Trouble installing and loading packages. Rtools isn’t in my version of R?
March 28, 2023 -

Let me start with: this is on my work computer and I work for a place where I am not allowed to download any software myself so I can’t try to update.

I have R version 4.2.1 (2022-06-23 ucrt).

So I was trying to download the tidy verse & ggplot2 and got the following error message:

library(ggplot2) Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):

there is no package called ‘colorspace’ In addition: Warning message: package ‘ggplot2’ was built under R version 4.2.3

——————-.

This led me to try to download colorspace, but that pulled this error:

install.packages('colorspace') 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/

Installing package into ‘C:/Users/twaj/AppData/Local/R/win-library/4.2’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/colorspace_2.1-0.zip'

Content type 'application/zip' length 2628852 bytes (2.5 MB) downloaded 2.5 MB package ‘colorspace’ successfully unpacked and MD5 sums checked The downloaded binary packages are in [the folder].

———————-.

So I tried to download Rtools but i get the same error. I need Rtools to download Rtools.

Any suggestions????

🌐
Rdrr.io
rdrr.io › cran › pkgbuild › man › has_rtools.html
has_rtools: Is Rtools installed? in pkgbuild: Find Tools Needed to Build R Packages
June 8, 2025 - Afterward, run rtools_path() to find out where it's installed. rtools_path() has_rtools(debug = FALSE) check_rtools(debug = FALSE) Either a visible TRUE if rtools is found, or an invisible FALSE with a diagnostic message(). As a side-effect the internal package variable rtools_path is updated ...
🌐
w3tutorials
w3tutorials.net › blog › rtools-is-required-to-build-r-packages-but-is-not-currently-installed
How to Fix 'Rtools is Required to Build R Packages' Error in R/RStudio (Even When Already Installed) — w3tutorials.net
If Rtools is installed but the error persists, the root cause is likely one of these: Let’s resolve the error with these targeted fixes: First, confirm Rtools is installed on your system: Run these commands in the R console to check for Rtools: ...
🌐
GitHub
github.com › r-lib › devtools › issues › 1772
find_rtools() doesn't recognize Rtools 3.5 in R 3.5.0 · Issue #1772 · r-lib/devtools
April 23, 2018 - I installed Rtools 3.5 from here, but when I run find_rtools() in the latest release of R 3.5.0 I get this · WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 3.5.0 was found.
Author   r-lib
🌐
YouTube
youtube.com › watch
Fixing the RTools Error Message in R (updated advice for Windows machines) - YouTube
This is an updated video on how to deal with the Rtools error message in R on Windows machines. WARNING: Rtools is required to build R packages but is not cu...
Published   December 29, 2022
Top answer
1 of 5
20

The message indicates RTools isn't installed properly. Download and install it like so:

  1. Go here
  2. Download rtools for your version of R
  3. Find the file that just downloaded
  4. Double click on it to start installation
  5. Close and reopen RStudio
  6. Everything should work now!

A nice 2-minute video explainer can be found here.


Why is RTools necessary in the first place?

Rtools adds are some tools to allow you to build packages. Not all packages need it; just the ones that use C, C++ or Fortran code.


If you have problems installing

  • If the instructions above don't result in a successful installation of Rtools, the following may help.
  • Re-install R. Try to stick to the default installation settings if possible. Don't forget to close all current R sessions before reinstalling, then start a new R session and see if it works as expected. If not, try downloading and installing Rtools as outlined at the top of this answer; hopefully it installs as expected now.
  • Make sure your anti-virus software isn't preventing it being installed. Anti virus software can sometimes mistake it for something harmful and quarantine it.
  • When reinstalling R, or when installing Rtools manually, be careful to look for any indication that you do not have write permissions to the drive you're installing to. If you don't have permission to install certain things, that may be what's causing Rtools to not install correctly. This is more likely to happen if there are multiple users on your Windows computer, or if your organisation has strict policies about what can be installed. To look into this, figure out where Rtools is being installed to, and ensure you have the ability to write to that folder.
2 of 5
3

If somoeone is still looking, be sure to check if you use the right version of Rtools. E.g. if you have R 4.3.3 install Rtools43 not Rtools44.

🌐
Reddit
reddit.com › r/rlanguage › issues installing rtools package
r/Rlanguage on Reddit: Issues installing Rtools package
April 20, 2024 -

I have Rstudio 2023.12.1 build 402.

I initially tried installing the Rtools package & got the following error:

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

I went to the below site & downloaded the Rtools43 installer, and am still getting the same error when i try running install.packages("Rtools") or install.packages("Rtools43").

https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html

Does anyone know what I'm doing wrong?

🌐
Posit Community
forum.posit.co › general
Rtools isn't being detected - General - Posit Community
October 28, 2022 - I'm trying to install some packages, and keep getting the following error: WARNING: Rtools 4.2 s required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding: ...
🌐
Posit Community
forum.posit.co › general
Rtools is required to build R packages but is not currently installed - General - Posit Community
February 21, 2021 - Please download and install the appropriate version of Rtools before proceeding: https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ‘C:/Users/Mephi/OneDrive/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)