简体   繁体   English

设置Rtools时无法重写PATH

[英]Unable to rewrite PATH when setting Rtools

In my windows 10, the directory of Rtools cannot be correctly set. 在我的Windows 10中,无法正确设置Rtools的目录。 My rtools is installed in D drive (D:/Rtools) and I've done these: 我的rtools安装在D驱动器(D:/ Rtools)中,我已经完成了这些操作:

  1. I manually set the PATH in the Environmental Variables... : screenshot for PATH 我在Environmental Variables...手动设置了PATH Environmental Variables...PATH的屏幕截图
  2. I changed the Makeconf : BINPREF ?= D:/Rtools/mingw_64/bin/ 我更改了MakeconfBINPREF ?= D:/Rtools/mingw_64/bin/

However, everytime restarting R, I get an Rtool path directing to C drive ( C:\\\\Rtools\\\\bin; ): 但是,每次重新启动R时,都会得到一个指向C驱动器的Rtool路径( C:\\\\Rtools\\\\bin; ):


Sys.getenv("PATH")
#> [1] "C:\\Rtools\\bin;D:\\R\\R-stable\\bin\\x64;d:\\Rtools\\bin;d:\\Rtools\\mingw_64\\bin;d:\\Rtools\\mingw_32\\bin;C:\\ProgramData\\Oracle\\Java\\javapath;D:\\Program Files\\ImageMagick-7.0.7-Q16;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;D:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;D:\\qpdf-6.0.0\\bin;D:\\qpdf-6.0.0\\lib;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Common Files\\Seagate\\SnapAPI\\;D:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\;D:\\Program Files (x86)\\WinMerge;d:\\Rtools\\bin;d:\\Rtools\\mingw_64\\bin;D:\\Ruby24-x64\\bin;D:\\Ruby25-x64\\bin;C:\\Users\\Yue Hu_local\\AppData\\Local\\Microsoft\\WindowsApps;"

Everything else looks fine and R seems able to find the rtools and relevants, while the packages cannot be compiled successfully from the source: 其他一切看起来都不错,R似乎能够找到rtools和相关内容,而软件包却无法从源代码成功编译:

devtools::find_rtools()
#> [1] TRUE
Sys.which("ls.exe")
#>                    ls.exe 
#> "d:\\Rtools\\bin\\ls.exe"
Sys.which("gcc.exe")
#>                              gcc.exe 
#> "d:\\Rtools\\mingw_64\\bin\\gcc.exe"

I think that the current version of RTools sets the path to c:\\Rtools\\bin no matter what you choose when you install RTools. 我认为,无论您在安装RTools时选择什么,RTools的当前版本都将路径设置为c:\\ Rtools \\ bin。 I believe this is done in Renviron.site in the etc folder of your R distribution. 我相信这是在R发行版的etc文件夹中的Renviron.site中完成的。 You could edit this file and give it the correct path. 您可以编辑此文件并提供正确的路径。 (Alternatively, if the correct version of Rtools is already in your path (ie you elected to modify the system path when you installed it) then you might get this to work by simply commenting-out (put a # in front of) the PATH= statement in Renviron.site. (或者,如果您的路径中已经存在正确版本的Rtools(即,您在安装时选择了修改系统路径),则可以通过简单地注释掉PATH(在路径前面加上#)使其工作。 = Renviron.site中的语句。

Does anyone know where to report this as a possible bug in the installation for RTools? 有谁知道在RTools安装中将其报告为可能的错误的地方?

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

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