This question already has answers here:
Error “.onLoad failed in loadNamespace() for 'tcltk'”

(6个答案)


已关闭6年。




尝试在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库问题,我将不胜感激。

提前致谢。

最佳答案

谢谢你的@ donal-fellows!

解决方案是将符号链接(symbolic link)放到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问题!

10-04 23:22