我正在尝试安装包" stringi"使用install.packages()但遇到以下错误:
PackDirB="C:\\Users\\PC\\Documents\\R\\win-library\\3.2\\stringi_0.5-5.tar.gz"
> install.packages(PackDirB, repos=NULL, type="source")
Installing package into ‘C:/Users/PC/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'stringi'
* removing 'C:/Users/Santos/Documents/R/win-library/3.2/stringi'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l
"C:\Users\PC\Documents\R\win-library\3.2" "C:/Users/PC/Documents/R/win-library/3.2/stringi_0.5-5.tar.gz"' had status 1
2: In install.packages(PackDirB, repos = NULL, type = "source") :
installation of package ‘C:/Users/PC/Documents/R/win-library/3.2/stringi_0.5-5.tar.gz’ had non-zero exit status
发生什么事了?我该怎么办?
答案 0 :(得分:0)
假设您在Windows操作系统下运行,您是否安装了Cygwin?尝试在控制台窗口中运行sh
命令,看看它是否识别它。如果没有,请从here安装Cygwin,然后再次尝试安装R软件包。 **注意:**确保将Cygwin的位置添加到PATH
。希望它有所帮助。
PATH变量是指Windows中的系统变量。将Cygwin.exe安装文件夹添加到PATH系统变量。
答案 1 :(得分:-1)
您需要拥有RTools installed。安装RTools对我来说摆脱了这个错误。