未从RStudio检测到Rtools [英] Rtools is not being detected from RStudio
问题描述
我正在使用最新的R,RStudio和Rtools.
-我已经更新了环境变量.现在,我可以从命令行调用gcc或R了.
当我尝试从RStudio发布应用程序时,出现以下错误,
准备部署应用程序...完成 应用程序:64015 ...错误: *应用程序取决于软件包"Rtools",但尚未安装.请先解决,然后再继续.执行停止
-我已经在控制台上尝试过
> find_rtools(T)
Scanning path...
ls : D:\Rtools\bin\ls.exe
gcc: D:\Rtools\GCC-46~1.3\bin\gcc.exe
VERSION.txt
Rtools version 3.3.0.1959
Version: 3.3
[1] TRUE
因此,Rtools似乎基本上就在那里!
-我已经检查了环境变量,因为我也提到过R和gcc可以从命令行启动
但是,我尝试使用安装程序包在RStudio内进行安装和检查,
> install.Rtools()
No need to install Rtools - You've got the relevant version of Rtools installed
>
-这是不可能的重复, R工具未被R检测到 我已经尝试了所有这些.没有用.
请提出解决方案.非常感谢您的宝贵时间.
我不知道RStudio为何会时不时出现此类问题,但是此处介绍了一种手动解决方法:
https: //github.com/rwinlib/r-base/wiki/Testing-Packages-with-Experimental-R-Devel-Build-for-Windows
基本上,您必须将两个环境变量设置为Rtools的正确安装路径:
Sys.setenv(PATH = paste("C:/Rtools/bin", Sys.getenv("PATH"), sep=";"))
Sys.setenv(BINPREF = "C:/Rtools/mingw_$(WIN)/bin/")
为避免重新启动RStudio后丢失此更改,您可以改为修改Windows环境变量,或将以下行添加到每次R启动时执行的.Renviron
文件中.
BTW:$(WIN)
部分是 no 错字,但必须输入,以便R可以根据所使用的R版本(32或64位)注入"32"或"64". /p>
:另请参见最近发布的这篇r-bloggers文章:
-- I have tried this,On Console, So, Rtools seems basically there! -- I have checked environment variables, those are OK, as I also mentioned R and gcc can be started from command line Yet, I tried to install and check from within RStudio using installr package, it says, -- This is not a possible duplication of this, Rtools not being detected by R
I have tried all these. Did not work. Please suggest a solution. Thank you very much for your time. I have no idea why RStudio has such kind of problems from time to time but there is a manual work-around described here: https://github.com/rwinlib/r-base/wiki/Testing-Packages-with-Experimental-R-Devel-Build-for-Windows Basically you have to set two environment variables to the correct installation path of Rtools: To avoid losing this change after restarting RStudio you could modify your Windows environment variables instead or add the following rows to your BTW: The Edit 1:: See also this r-bloggers article published recently: https://www.r-bloggers.com/quirks-about-running-rcpp-on-windows-through-rstudio/ 这篇关于未从RStudio检测到Rtools的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!> find_rtools(T)
Scanning path...
ls : D:\Rtools\bin\ls.exe
gcc: D:\Rtools\GCC-46~1.3\bin\gcc.exe
VERSION.txt
Rtools version 3.3.0.1959
Version: 3.3
[1] TRUE
> install.Rtools()
No need to install Rtools - You've got the relevant version of Rtools installed
>
Sys.setenv(PATH = paste("C:/Rtools/bin", Sys.getenv("PATH"), sep=";"))
Sys.setenv(BINPREF = "C:/Rtools/mingw_$(WIN)/bin/")
.Renviron
file that is executed at each startup of R.$(WIN)
part is no typo but required so that R can inject "32" or "64" depending on the R version you are using (32 or 64 bit).