2011-04-06 309 views
9

我正在尝试在R中执行多个插补并安装了Amelia并试图打开AmeliaView,但它表示需要tcltk包。我继续安装tcltk,但弹出如下错误消息。有人能帮助我吗?无法加载R中的包tcltk

> AmeliaView() 
Loading required package: tcltk 
Loading Tcl/Tk interface ... 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/2.12/Resources/library/tcltk/libs/i386/tcltk.so': 
    dlopen(/Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so, 10): Library not loaded: /usr/local/lib/libtcl8.5.dylib 
    Referenced from: /Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so 
    Reason: image not found 
Error in AmeliaView() : The package 'tcltk' is required 

> require(tcltk2) 
Loading required package: tcltk2 
Loading required package: tcltk 
Loading Tcl/Tk interface ... 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/2.12/Resources/library/tcltk/libs/i386/tcltk.so': 
    dlopen(/Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so, 10): Library not loaded: /usr/local/lib/libtcl8.5.dylib 
    Referenced from: /Library/Frameworks/R.framework/Versions/2.12/Resources/library/tcltk/libs/i386/tcltk.so 
    Reason: image not found 
Failed with error: ‘package 'tcltk' could not be loaded’ 
+1

蒙山那些样的错误,如果你提到的操作系统和版本,它是非常有用的。 – 2011-04-06 14:34:23

+0

请参阅:https://stat.ethz.ch/pipermail/r-help/2010-November/258276.html – 2011-04-06 14:29:26

+0

注意:如果您从源代码构建了R,则需要在当时启用'tcl-tk'。 – isomorphismes 2014-11-04 00:29:23

回答