2011-04-06 307 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

回答