How do I get Rtools 3.0 working for R 3.0? R can't find the installation
Asked Answered
D

5

14

I'm trying to get R to recognize that I have installed Rtools.exe. I've tried installing it in several different locations. However, whenever I restart R and load devtools I get the same error:

> library(devtools)   
WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools 3.0 from http://cran.r-project.org/bin/windows
/Rtools/ and then run find_rtools().

Naturally, whenever I try the function find_rtools() I get the same error message. I'm done trying to figure this out with help files, as the devtools help doesn't offer much. I've tried installing in several of the locations returned by get_path() but the problem persists.

FYI, currently my R is installed at D:/R.

Has anyone else had this problem, and more importantly, can anyone help me? I'm sorry if this is a duplicate, and I've tried to include as many relevant details as possible so if you need any clarification please let me know.

Thanks, Nick

Dryden answered 17/5, 2013 at 19:29 Comment(19)
What version of devtools do you have? It doesn't offer much help because it should just work.Mathi
I am currently using devtools version 1.2.Dryden
Can you please run find_rtools(T) and include the output?Mathi
> find_rtools(T) Scanning path... Scanning registry... WARNING: Rtools is required to build R packages, but is not currently installed. Please download and install Rtools 3.0 from http://cran.r-project.org/bin/windows/Rtools/ and then run find_rtools().Dryden
How are you installing Rtools? Are you choosing any custom options on install?Mathi
No custom options, but unfortunately I work at a place with a secure (and frankly backwards) IT system in which I am not able, as a user, to change the C: drive or install programs on to it. I am also not allowed to edit the system PATH. But I installed it to D:/Rtools and added this to the user path, and that location does show up when I call get_path().Dryden
Did you add both D:/Rtools and D:/Rtools/gcc-4.6.3/bin to your path?Mathi
I added both of those as well as D:/Rtools/gcc-4.6.3/bin32 for good measure, but unfortunately I get the same problem. Do you think it has something to do with system path vs. user path?Dryden
What do Sys.which("gcc") and Sys.which("ls") return?Mathi
The first returns gcc "D:\\Rtools\\GCC-46~1.3\\bin\\gcc.exe"Dryden
The second returns ls ""Dryden
So you don't have the path set up correctly - you need to figure out where ls.exe is on your computer and make sure that's in your path.Mathi
OK I seem to have several instances of ls.exe in different folders: cygwin, MinGW, Rtools itself, e.g. I've tried adding these to the path and retrying Sys.which('ls'), but I keep getting a blank. I made sure to add each individually and removing the one before it, and I always restart R. Would you know which is the correct version of ls.exe to add to the path?Dryden
And thank you so much for your extensive help, tailored to a noob like me.Dryden
You want the ls.exe in Rtools/bin. And you're welcomeMathi
Thanks, that seems to sort of work in that it's bringing me new problems. Now it seems as though both Rtools 3.0 and Rtools 3.1 are incompatible with R 3.0.1. Have you run into this? The exact error message when loading devtools is WARNING: Rtools 3.1 found on the path at D:/Rtools is not compatible with R 3.0.1. Please download and install the appropriate version of Rtools from http://cran.r-project.org/bin/windows/Rtools/, remove the incompatible version from your PATH, then run find_rtools().Dryden
Same message for Rtools 3.0Dryden
Yes, that's fixed in the version of devtools I just pushed to cran. Will probably be a couple of days before it's available.Mathi
I got devtools 1.3 and Rtools was found! Thanks so much!Dryden
U
2

Grab the batch file Rpathset.bat from batchfiles, edit the SET statements in it appropriately and then run R like this from the Windows console:

Rpathset
Rgui
Ultun answered 17/5, 2013 at 19:55 Comment(2)
Thanks for your solution, but I should mention that I don't have permission to edit the path on the computer, nor can I install software on the C:\ drive, where the WINDOWS registry is. This also means I can't install anything to the windows path. I realize this makes things difficult. But supposedly if Rtools is installed on the R path, it should work, right? The R path is on the D:/ drive. Could you please provide some further advice within these restrictions?Dryden
Note that its not true that you can't change the path in a local process. You don't need any permissions for that. The solution posted works without any special permissions. No change to the registry is involved. All you do is edit the .bat file and run it followed by running Rgui in the same console session.Ultun
C
2

I ran into this issue running a Windows 7 machine without admin rights. I leveraged G. Grothendieck's response, with a few additional steps.

  1. Get Rpathset.bat from https://code.google.com/p/batchfiles/
  2. Edit the Set statements in Rpathset.bat to your paths
  3. Run CMD and change directories to where Rpathset.bat is stored
  4. In the command prompt, run rpathset.bat > mypath.txt
  5. Open mypath.txt with a text editor
  6. Click Windows Start and search for environment
  7. Click Edit environment variables for your account
  8. Click path and then edit
  9. Copy and paste the entire path from mypath.txt into the Windows path (everything after the path statement)
  10. Restart RStudio and check that devtools::find_rtools() is TRUE
Clockwork answered 25/11, 2015 at 20:9 Comment(1)
actually you just need step 6 - 8. i.e. add C:\RTools;C:\RTools\gcc-4.6.3\bin to PATH by clicking Edit... (creating a New... if PATH does not exists")Fiertz
M
0

This file rtools.r contains the code for find_rtools(). It looks like it is trying to find ls and gcc in your system path (and then does some more checks based on the version) and if that fails it tries to look up SOFTWARE\R-core\Rtools in the the Windows registry.

Menispermaceous answered 17/5, 2013 at 19:40 Comment(0)
A
0

As Thomas mentioned here, "Rtools is not a package." This is what I did to install Rtools. My RStudio is running R version 3.1.3. So I downloaded Rtools31.exe from https://cran.r-project.org/bin/windows/Rtools/. I executed the exe file, selected all the default options in the Setup Wizard and installed. (I had admin privilege on the computer I was using but I am not sure if that makes any difference.) To check that it was properly installed, you can enter find_rtools() in the R prompt which should return TRUE if Rtools installed properly.

For R 3.0, you probably just need to download Rtools30.exe and follow the same steps above.

Achlamydeous answered 11/11, 2015 at 14:52 Comment(0)
R
0

I ran into this problem trying to install Rtools33 to use Hadley Wickham's lineprof package. I got that error multiple times. I'm running Windows 7 on a laptop.

I was able to fix the problem by running the Rtools installation file as the windows Admin (i.e. right-click the Rtools33.exe and choose "Run as administrator")

I also made sure to point the path to the R source directory, which I kept in C:\Rtools\ (which contains C:\Rtools\bin\ and C:\Rtools\gcc-4.6.3\).

This solved the problem for me and I am now able to install lineprof from GitHub and make use of it.

Rolland answered 24/6, 2016 at 19:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.