【发布时间】:2016-10-13 01:58:51
【问题描述】:
在 RStudio 中,我尝试在these instructions 之后从 github 安装 data.table 包,并且该包似乎可以毫无问题地下载:
> library(devtools)
> dev_mode(on=T)
Dev mode: ON
d> install_github("Rdatatable/data.table")
Downloading GitHub repo Rdatatable/data.table@master
from URL https://api.github.com/repos/Rdatatable/data.table/zipball/master
然后我收到以下提示:
从源代码构建 R 包需要安装额外的 构建工具。您想现在安装其他工具吗?
选择“是”会导致此错误消息:
Error: Could not find build tools necessary to build data.table
认为这可能是 RStudio 的问题,我尝试在标准 R 控制台中安装该软件包,但这也导致了错误:
Downloading GitHub repo Rdatatable/data.table@master
from URL https://api.github.com/repos/Rdatatable/data.table/zipball/master
Installing data.table
"C:/PROGRA~1/R/R-33~1.0/bin/x64/R" --no-site-file --no-environ --no-save \
--no-restore --quiet CMD INSTALL \
"C:/Users/Robert/AppData/Local/Temp/RtmpOOKOKu/devtools246832c52ab/Rdatatable-data.table-4348ff4" \
--library="C:/Users/Robert/Documents/R-dev" --install-tests
* installing *source* package 'data.table' ...
** libs
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-33~1.0/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -fopenmp -O2 -Wall -std=gnu99 -mtune=core2 -c assign.c -o assign.o
c:/Rtools/mingw_64/bin/gcc: not found
make: *** [assign.o] Error 127
Warning: running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-33~1.0/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.0/share/make/winshlib.mk" SHLIB="data.table.dll" WIN=64 TCLBIN=64 OBJECTS="assign.o bmerge.o chmatch.o dogroups.o fastmean.o fcast.o fmelt.o forder.o frank.o fread.o fwrite.o gsumm.o ijoin.o init.o openmp-utils.o quickselect.o rbindlist.o reorder.o shift.o subset.o transpose.o uniqlist.o vecseq.o wrappers.o"' had status 2
ERROR: compilation failed for package 'data.table'
* removing 'C:/Users/Robert/Documents/R-dev/data.table'
Error: Command failed (1)
d>
我在 SO 上找到了三个相关的帖子:
Error: Could not find build tools necessary to build dplyr
Error : Could not find build tools necessary to build
Could not find build tools necessary . Facing error with devtools
前两个似乎特定于 Apple OS,第三个表明特定于 devtools 的错误,但我不知道这是否是我看到的错误的根源。
任何帮助将不胜感激。我在 Windows 10 中运行 R 版本 3.3.0。
【问题讨论】:
-
@Procrastinatus 感谢您的链接。当我执行这些说明中描述的 install.packages 命令时,R 报告“安装包‘data.table’具有非零退出状态”。由于时间关系,我暂时跳过这个,直接使用 data.frame 代替 data.table。
-
为什么不用CRAN version 而不是开发版?
-
因为我的代码受到开发版本中修复的错误的影响。
-
很清楚为什么会发生错误:您没有安装此软件包。尝试安装 RTools(参见第一条评论中的链接)