R语言安装本地包Warning in system(cmd) : ‘make‘ not found安装和R版本匹配的Rtools

Posted Data+Science+Insight

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了R语言安装本地包Warning in system(cmd) : ‘make‘ not found安装和R版本匹配的Rtools相关的知识,希望对你有一定的参考价值。

R语言安装本地包、Warning in system(cmd) : 'make' not found、安装和R版本匹配的Rtools

目录

R语言安装本地包、Warning in system(cmd) : 'make' not found、安装和R版本匹配的Rtools

 问题:

解决:

完整错误:


 问题:

> install.packages("D:/Downloads/RGtk2_2.20.36.3.tar.gz", repos = NULL, type = "source")
* installing *source* package 'RGtk2' ...
** 成功将'RGtk2'程序包解包并MD5和检查
** using staged installation
** libs

*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'RGtk2'
* removing 'D:/R/R-4.0.5/library/RGtk2'
Warning in install.packages :
  installation of package ‘D:/Downloads/RGtk2_2.20.36.3.tar.gz’ had non-zero exit status

解决:

使用Rstudio中的tools中的install pcakage手动安装本地包

#接着发生如下错误;

#可能原因是Rtools的问题,

确实没有找到make所以没法安装。

 > Sys.which("make")
make 
  "" 

> pkgbuild::find_rtools(debug = TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE

> install.packages("D:/Downloads/RGtk2_2.20.36.3.tar.gz", repos = NULL, type = "source")
* installing *source* package 'RGtk2' ...
** 成功将'RGtk2'程序包解包并MD5和检查
** using staged installation
** libs

*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'RGtk2'
* removing 'D:/R/R-4.0.5/library/RGtk2'
Warning in install.packages :
  installation of package ‘D:/Downloads/RGtk2_2.20.36.3.tar.gz’ had non-zero exit status

 #R版本和Rtools需要匹配哦

 安装Rtools

#如下操作(记得如果操作之后没有反应,需要重启Rstudio)

writeLines('PATH="$RTOOLS40_HOME\\\\usr\\\\bin;$PATH"', con = "~/.Renviron")

> Sys.which("make")
                                      make 
"D:\\\\Rtools\\\\rtools40\\\\usr\\\\bin\\\\make.exe" 

> pkgbuild::find_rtools(debug = TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE

完整错误:

> install.packages("D:/Downloads/RGtk2_2.20.36.3.tar.gz", repos = NULL, type = "source")
* installing *source* package 'RGtk2' ...
** 成功将'RGtk2'程序包解包并MD5和检查
** using staged installation
** libs

*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'RGtk2'
* removing 'D:/R/R-4.0.5/library/RGtk2'
Warning in install.packages :
  installation of package ‘D:/Downloads/RGtk2_2.20.36.3.tar.gz’ had non-zero exit status

参考:R

参考:Index of /src/contrib/Archive/RGtk2

以上是关于R语言安装本地包Warning in system(cmd) : ‘make‘ not found安装和R版本匹配的Rtools的主要内容,如果未能解决你的问题,请参考以下文章

R语言sys方法:sys.timezone函数返回当前系统时区的名称system.File函数查找系统文件或者安装包的文件路径(例如查看R Base可安装路径dplyr包的安装路径)

R语言安装包时遇到arch - i386错误时解决方案

r语言curve函数安装啥包

r语言 为啥要安装rtools

如何安装Go语言安装包

R语言检测包是否已安装