在OS X上安装RMySQL时出错

时间:2022-09-19 07:55:03

I'm running into an issue installing the RMySQL package on OS X. Package installation seems to work, but when package loading is tested, it invariably fails:

我遇到了在OS X上安装RMySQL软件包的问题。软件包安装似乎有效,但是在测试软件包加载时,它总是会失败:

* installing *source* package ‘RMySQL’ ...
. 
.(omitted for brevity. see the gist linked below for the full installation log)
.
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'RMySQL', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RMySQL/libs/i386/RMySQL.so':
  dlopen(/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RMySQL/libs/i386/RMySQL.so, 6): Symbol not found: _mysql_affected_rows
  Referenced from: /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RMySQL/libs/i386/RMySQL.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RMySQL/libs/i386/RMySQL.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RMySQL’

The full installation log can be found on this gist.

完整的安装日志可以在这个要点上找到。

This seems to have something to do with running R in 32 bit vs. 64 bit mode. I've read through and tried everything in these to no avail:

这似乎与在32位与64位模式下运行R有关。我已经通读并尝试了其中的所有内容无济于事:

System information:

系统信息:

  • R 2.15.2
  • R 2.15.2
  • OS X 10.8.3 (Mountain Lion)
  • OS X 10.8.3(Mountain Lion)
  • MySQL 5.1.45
  • MySQL 5.1.45
  • XCode 3.2
  • XCode 3.2

2 个解决方案

#1


3  

Take a look at this memo from Simon Urbanek on the R-sig-Mac list in February:

在2月的R-sig-Mac列表中查看Simon Urbanek的这份备忘录:

https://stat.ethz.ch/pipermail/r-sig-mac/2013-February/009967.html

https://stat.ethz.ch/pipermail/r-sig-mac/2013-February/009967.html

"Ah, hold on - you are on Mountain Lion and you may have installed R with 32-bit default since 10.8 was omitted from the list of supported 64-bit systems at the time - try installing latest R 2.15.3 RC from http://r.research.att.com/"

“啊,等等 - 你在Mountain Lion上,你可能已经安装了R的32位默认值,因为当时支持的64位系统列表中省略了10.8 - 尝试从http安装最新的R 2.15.3 RC: //r.research.att.com/”

You should also make sure that the RMySQL version is appropriate for version 2.15 since CRAN would now be serving up a version that expects R 3.0.0 to be running. Actually that should not be the problem since RMySQL_0.9-3 is in the 2.15 binaries trunk at the UCB CRAN mirror: http://cran.cnr.berkeley.edu/bin/macosx/leopard/contrib/2.15/RMySQL_0.9-3.tgz

您还应该确保RMySQL版本适用于版本2.15,因为CRAN现在将提供一个期望R 3.0.0正在运行的版本。实际上这应该不是问题,因为RMySQL_0.9-3在UCB CRAN镜像的2.15二进制文件中继:http://cran.cnr.berkeley.edu/bin/macosx/leopard/contrib/2.15/RMySQL_0.9 -3.tgz

#2


3  

I just found a solution to this issue. My R version is

我刚刚找到了解决这个问题的方法。我的R版本是

>  R.version          _
platform       x86_64-apple-darwin12.4.0
arch           x86_64
os             darwin12.4.0
system         x86_64, darwin12.4.0
status
major          3
minor          0.1
year           2013
month          05
day            16
svn rev        62743
language       R
version.string R version 3.0.1 (2013-05-16)
nickname       Good Sport

All I needed to do was copy the libmysqlclient lib to the R lib dir.

我需要做的就是将libmysqlclient lib复制到R lib目录。

You can find a step by step guide here and here

您可以在此处和此处找到分步指南

#1


3  

Take a look at this memo from Simon Urbanek on the R-sig-Mac list in February:

在2月的R-sig-Mac列表中查看Simon Urbanek的这份备忘录:

https://stat.ethz.ch/pipermail/r-sig-mac/2013-February/009967.html

https://stat.ethz.ch/pipermail/r-sig-mac/2013-February/009967.html

"Ah, hold on - you are on Mountain Lion and you may have installed R with 32-bit default since 10.8 was omitted from the list of supported 64-bit systems at the time - try installing latest R 2.15.3 RC from http://r.research.att.com/"

“啊,等等 - 你在Mountain Lion上,你可能已经安装了R的32位默认值,因为当时支持的64位系统列表中省略了10.8 - 尝试从http安装最新的R 2.15.3 RC: //r.research.att.com/”

You should also make sure that the RMySQL version is appropriate for version 2.15 since CRAN would now be serving up a version that expects R 3.0.0 to be running. Actually that should not be the problem since RMySQL_0.9-3 is in the 2.15 binaries trunk at the UCB CRAN mirror: http://cran.cnr.berkeley.edu/bin/macosx/leopard/contrib/2.15/RMySQL_0.9-3.tgz

您还应该确保RMySQL版本适用于版本2.15,因为CRAN现在将提供一个期望R 3.0.0正在运行的版本。实际上这应该不是问题,因为RMySQL_0.9-3在UCB CRAN镜像的2.15二进制文件中继:http://cran.cnr.berkeley.edu/bin/macosx/leopard/contrib/2.15/RMySQL_0.9 -3.tgz

#2


3  

I just found a solution to this issue. My R version is

我刚刚找到了解决这个问题的方法。我的R版本是

>  R.version          _
platform       x86_64-apple-darwin12.4.0
arch           x86_64
os             darwin12.4.0
system         x86_64, darwin12.4.0
status
major          3
minor          0.1
year           2013
month          05
day            16
svn rev        62743
language       R
version.string R version 3.0.1 (2013-05-16)
nickname       Good Sport

All I needed to do was copy the libmysqlclient lib to the R lib dir.

我需要做的就是将libmysqlclient lib复制到R lib目录。

You can find a step by step guide here and here

您可以在此处和此处找到分步指南