简体   繁体   English

无法安装RMySQL软件包,错误c:/ Rtools / mingw_32 / bin / gcc:未找到

[英]unable to install RMySQL package, error c:/Rtools/mingw_32/bin/gcc: not found

I use windows 10, installed MySQL under "C:\\Program Files\\MySQL\\MySQL Server 5.7", installed R under "D:\\R\\R-3.3.2", installed Rtools under "D:\\Rtools", installed RStudio under "D:\\RStudio". 我使用Windows 10,在“ C:\\ Program Files \\ MySQL \\ MySQL Server 5.7”下安装了MySQL,在“ D:\\ R \\ R-3.3.2”下安装了R,在“ D:\\ Rtools”下安装了Rtools,并安装了RStudio在“ D:\\ RStudio”下。 then i followed below steps to install RMySQL package: 然后我按照以下步骤安装RMySQL软件包:

1: added MYSQL_HOME = C:\\Program Files\\MySQL\\MySQL Server 5.7\\ in my environment variables. 1:在我的环境变量中添加了MYSQL_HOME = C:\\ Program Files \\ MySQL \\ MySQL Server 5.7 \\。

2: created Renviron.site file under "D:\\R\\R-3.3.2\\etc" with content: MYSQL_HOME=C:/Program Files/MySQL/MySQL Server 5.7/ 2:在“ D:\\ R \\ R-3.3.2 \\ etc”下创建内容为:MYSQL_HOME = C:/ Program Files / MySQL / MySQL Server 5.7 /的Renviron.site文件

3: verified that Path value under my environment variables -> system variables does contain:D:\\Rtools\\bin;D:\\Rtools\\mingw_32\\bin;... 3:验证我的环境变量->系统变量下的Path值确实包含:D:\\ Rtools \\ bin; D:\\ Rtools \\ mingw_32 \\ bin; ...

4: run install.packages("RMySQL", type = "source") on RStudio. 4:在RStudio上运行install.packages(“ RMySQL”,type =“ source”)。

But i get error message below: 但我收到以下错误消息:

> install.packages("RMySQL", type = "source")
trying URL 'https://cran.rstudio.com/src/contrib/RMySQL_0.10.9.tar.gz'
Content type 'application/x-gzip' length 54012 bytes (52 KB)
downloaded 52 KB

* installing *source* package 'RMySQL' ...
** 成功将'RMySQL'程序包解包并MD5和检查
** libs

*** arch - i386
rm -f RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o RMySQL.dll
"D:/R/R-3.3.2/bin/i386/Rscript.exe" "../tools/winlibs.R"
c:/Rtools/mingw_32/bin/gcc  -I"D:/R/R-3.3.2/include" -DNDEBUG -I../windows/libmariadbclient-2.1.0/include    -I"d:/Compiler/gcc-4.9.3/local330/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c RMySQL-init.c -o RMySQL-init.o
c:/Rtools/mingw_32/bin/gcc: not found
make: *** [RMySQL-init.o] Error 127
Warning: 运行命令'make -f "Makevars.win" -f "D:/R/R-3.3.2/etc/i386/Makeconf" -f "D:/R/R-3.3.2/share/make/winshlib.mk" SHLIB="RMySQL.dll" OBJECTS="RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o"' had status 2
ERROR: compilation failed for package 'RMySQL'
* removing 'D:/R/R-3.3.2/library/RMySQL'
Warning in install.packages :
  running command '"D:/R/R-3.3.2/bin/x64/R" CMD INSTALL -l "D:\R\R-3.3.2\library" C:\Users\Xuan\AppData\Local\Temp\RtmpkjaBSm/downloaded_packages/RMySQL_0.10.9.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘RMySQL’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\Xuan\AppData\Local\Temp\RtmpkjaBSm\downloaded_packages’

I see the error message says "c:/Rtools/mingw_32/bin/gcc: not found", this may be because i have RTools installed under D drive. 我看到错误消息显示“ c:/ Rtools / mingw_32 / bin / gcc:未找到”,这可能是因为我在D盘下安装了RTools。 I can install other R package successfully(which means Rtools can be used in R), but i don't know why this installation get the wrong path. 我可以成功安装其他R软件包(这意味着Rtools可以在R中使用),但是我不知道为什么此安装路径错误。 Can anyone help to solve this? 谁能帮助解决这个问题? thanks a lot! 非常感谢!

this issue was fixed by copying the whole Rtools folder to C drive. 通过将整个Rtools文件夹复制到C驱动器来解决此问题。 R can load RMySQL package correctly although this consumed quite a lot of space of my system drive. R可以正确加载RMySQL软件包,尽管这占用了我系统驱动器的大量空间。

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

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