在MacBookPro上安装Rcmdr包时出现TclTk库问题

时间:2013-08-31 17:36:43

标签: r macos tcl graphviz tk

尝试在MacBook Pro上加载Rcmdr for R时出现以下错误:

> library("Rcmdr")
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk/libs/tcltk.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /usr/local/lib/libtcl8.6.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk/libs/tcltk.so
  Reason: image not found
Error: package or namespace load failed for ‘Rcmdr’

我在这台机器上遇到了与TclTk库相关的其他问题,但是当我发布有关安装graphviz的麻烦时,我没有得到任何帮助。

如果有人可以帮我修复TclTk库问题,我会非常感激。

提前致谢。

1 个答案:

答案 0 :(得分:5)

感谢@ donal-fellows!

解决方案是将符号链接放到R期望它们的库中:

brew remove tcl-tk
brew -v install tcl-tk --with-tk
ln -s /usr/local/Cellar/tcl-tk/8.6.0/lib/libtcl8.6.dylib /usr/local/lib/libtcl8.6.dylib
ln -s /usr/local/Cellar/tcl-tk/8.6.0/lib/libtk8.6.dylib /usr/local/lib/libtk8.6.dylib

现在让我们希望这可以解决我的graphviz问题!