简体   繁体   中英

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

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

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

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

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.

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.

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 (ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM