简体   繁体   English

没有找到与R版本3.5.0兼容的RTools

[英]No RTools compatible with R version 3.5.0 was found

I had problems installing data.table for R version 3.5.0, and was advised to check that RTools was properly installed. 我在安装R版本3.5.0的data.table时遇到问题,并建议检查是否正确安装了RTools。

After installing RTools 3.5 (this seems to be the latest) I typed 安装了RTools 3.5(这似乎是最新的)我输入了

find_rtools(T)

I got the following message: 我收到以下消息:

WARNING: Rtools is required to build R packages, but no version 
of Rtools compatible with R 3.5.0 was found. 
(Only the following incompatible version(s) of Rtools were found:3.4,3.5)

Please download and install the appropriate version of Rtools from 
http://cran.r-project.org/bin/windows/Rtools/.

So on the one hand it looks like I do have 3.5 installed, but it seems to think there is a newer/different version. 所以一方面它看起来我安装了3.5,但它似乎认为有一个更新/不同的版本。

Any thoughts? 有什么想法吗?

The problem was Rtools 3.5 was not in your Windows system PATH thus find_rtools couldn't find it. 问题是Rtools 3.5不在您的Windows系统PATH因此find_rtools无法找到它。 Another possibility was that an incompatible version of Rtools was in the PATH 另一种可能性是, PATH中存在不兼容的Rtools版本

Best practice for installing Rtools : 安装Rtools最佳实践:

  • Download the latest version 下载最新版本
  • Install RTools at default recommended location (at the root of your C drive): C:/Rtools/ 在默认的推荐位置安装RTools (在C盘的根目录下): C:/Rtools/

  • < Important > Check the box that allows Rtools to modify system PATH < 重要 >选中允许Rtools修改系统路径的框

在此输入图像描述 在此输入图像描述

After the installation, we can double check by running this command inside R 安装完成后,我们可以通过在R里面运行这个命令来仔细检查

R> Sys.getenv('PATH')
[1] "C:\\Program Files\\R\\R-3.5.0\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\mingw_64\\bin;

See also this guide 另见本指南


Edit : for those who don't have Administration rights, see these links: 编辑 :对于没有管理权限的人,请参阅以下链接:

UPDATE UPDATE

The utility find_rtools has been moved to the package pkgbuild (as noted in devtools News ). 实用程序find_rtools已移至包pkgbuild (如devtools News中所述 )。 The function pkgbuild::find_rtools() correctly discovers Rtools 3.5 in my system. 函数pkgbuild::find_rtools()在我的系统中正确发现了Rtools 3.5。

Old answer 老答案

I had this same problem and it occurs because devtools has not been updated to consider the newest version of RTools (3.5). 我有同样的问题,因为devtools尚未更新以考虑最新版本的RTools(3.5)。 Here is an easy fix that should work while they update the package: 这是一个简单的修复,它应该在更新包时起作用:

# add missing RTools 3.5 info
v_i = devtools:::version_info
v_i[["3.5"]] = v_i[["3.4"]]
v_i[["3.5"]]$version_max = "3.5.99"
assignInNamespace(x     = "version_info",
                  value = v_i,
                  ns    = "devtools")

# now find_rtools should work properly
devtools::find_rtools()

Of course, this approach assumes that devtools::find_rtools worked for you before updating R and RTools. 当然,这种方法假设devtools::find_rtools在更新R和RTools之前为您工作。 If this is not the case, then you might have a faulty installation and/or PATH variable as others have mentioned. 如果不是这种情况,那么您可能会遇到其他人提到的错误安装和/或PATH变量。

I'm quite sure RTools 3.5 works with R-3.5 . 我很确定RTools 3.5适用于R-3.5。 I haven't used find_rtools() before, but I did manage to compile data.table from source a week ago. 我之前没有使用过find_rtools(),但我确实设法在一周前从源代码编译data.table。 Here's how I did it: 我是这样做的:

After installing R 3.5 and RTools 3.5, I manually checked/modified the following system-envs (somehow the RTools installer failed to do this automatically, so I went through the readme from RTools and do it manually): BINREF = "C:/Rtools/mingw_$(WIN)/bin/" (with "s, slashes are /) PATH = ";C:\\Rtools\\bin" ("s are optional , slashes are \\ ) 安装R 3.5和RTools 3.5之后,我手动检查/修改了以下system-envs(不知何故,RTools安装程序无法自动执行此操作,因此我从RTools读取了自述文件并手动完成):BINREF =“C:/ Rtools / mingw _ $(WIN)/ bin /“(带”s,斜杠是/)PATH =“; C:\\ Rtools \\ bin”(“s是可选的,斜杠是\\)

Then I downloaded the source package for data.table(was version 1.10.4-3) and ran R CMD INSTALL data.table_1.10.4-3.tar.gz from windows command-line. 然后我下载了data.table的源包(版本为1.10.4-3),并从windows命令行运行了R CMD INSTALL data.table_1.10.4-3.tar.gz。 With a working RTools, the package would successfully compile. 使用工作的RTools,包将成功编译。 I also tried the install.packages(data.table) from R-GUI, where I got pop-up window to confirm compilation from source. 我还尝试了来自R-GUI的install.packages(data.table),我在弹出窗口中确认从源代码编译。

Anyway, I believe cran now provides a working windows-binary for data.table, so using RTools is no longer necessary. 无论如何,我相信cran现在为data.table提供了一个工作的windows-binary,因此不再需要使用RTools。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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