简体   繁体   English

无法安装 rtools 并正确配置路径

[英]Unable to install rtools and configure the path correctly

I followed this instructions to install R and Rstudio, specifically, in the installation of R, I set C:\\R\\R-3.4.1 as the folder to store R instead of C:\\Program Files\\R\\R-3.4.1 to avoid any possible issues with space in the path.我按照这个说明安装了R和Rstudio,具体来说,在R的安装中,我设置了C:\\R\\R-3.4.1作为存放R的文件夹,而不是C:\\Program Files\\R\\R-3.4.1以避免任何可能的路径空间问题。 Then I followed this instruction step by step to download and install the latest version of rtools .然后我按照这个说明一步一步下载并安装了最新版本的rtools Specifically, during the installation of rtools, there is a message box具体在rtools安装过程中,有一个消息框在此处输入图片说明 And I followed the instruction and click both of them.我按照说明操作并单击它们。

Then I open Rstudio (at this moment, it is all fresh, I didn't install any R packages except for those basic ones that comes with Rstudio) and install.packages("devtools") then everything looks smooth然后我打开Rstudio (此时,一切都是新鲜的,除了 Rstudio 附带的那些基本包之外,我没有安装任何 R 包)和install.packages("devtools")然后一切看起来都很顺利

package ‘withr’ successfully unpacked and MD5 sums checked
package ‘devtools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\FTXX\AppData\Local\Temp\RtmpK2EE70\downloaded_packages

Then然后

library(devtools)
find_rtools(T)
Error: running command '"C:/R/R-34~1.1/bin/x64/R" --no-site-file --no-
environ --no-save --no-restore --quiet CMD config CC' had status 65535

My system path is我的系统路径是

Sys.getenv()['PATH']
PATH                     C:\R\R-
3.4.1\bin\x64;c:\Rtools\bin;c:\Rtools\mingw_32\bin;C:\R\R-
3.4.1\bin;C:\Program
                     Files\mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0\mingw64\bin\;C:\Users\FTXX\AppData\Local\Continuum\Anaconda3;C:\Users\FTXX\AppData\Local\Continuum\Anaconda3\Scripts;C:\Users\FTXX\AppData\Local\Continuum\Anaconda3\Library\bin

I also found that the output of Sys.getenv()['PATH'] and shell("PATH") generates different message.我还发现Sys.getenv()['PATH']shell("PATH")生成不同的消息。 In Shell('PATH') is saysShell('PATH')中说

Warning messages:
1: running command 'C:\Program Files\mingw-w64\x86_64-5.3.0-posix-seh-
rt_v4-rev0\mingw64\bin /c PATH' had status 127 
2: In shell("PATH") : 'PATH' execution failed with error code 127

I also output some variables我也输出一些变量

Sys.which("ls.exe")
ls.exe 
"c:\\Rtools\\bin\\ls.exe" 
Sys.which("gcc.exe")
gcc.exe 
"c:\\Rtools\\mingw_32\\bin\\gcc.exe" 

and my R is 3.4.1 and I am on Windows 10. Any suggestions are appreciated.我的 R 是 3.4.1,我在 Windows 10 上。任何建议表示赞赏。

Maybe you can use the installr package to download and install Rtools .也许您可以使用installr包来下载和安装Rtools

try this in your IDE I did it in RStudio.在你的 IDE 中试试这个我在 RStudio 中做到了。

install.packages("installr")

Then, when the package is installed, make it available with然后,当安装包时,使其可用

library("installr")

At this point, you are good to go!此时,您可以开始了!

Install Rtool using the following使用以下命令安装 Rtool

install.Rtools()

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

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