简体   繁体   中英

Error: .onLoad failed in loadNamespace() for 'tcltk', details:

I have Archlinux and I try to run install.packages("zoo") and I get the following error message :

Error: .onLoad failed in loadNamespace() for 'tcltk', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/usr/lib/R/library/tcltk/libs/tcltk.so': libtk8.6.so: cannot open shared object file: No such file or directory

I know this problem has already been asked on this site but I can't find a working answer.

capabilities("tcltk")
# tcltk 
#  TRUE

library(tcltk)

Error : .onLoad failed in loadNamespace() for 'tcltk', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/usr/lib/R/library/tcltk/libs/tcltk.so': libtk8.6.so: cannot open shared object file: No such file or directory Error: package or namespace load failed for 'tcltk'

Any idea on how to fix this problem ?

Archlinux offers the needed package your system is searching for.

  1. Install this package on your system
  2. Subsequent install tcltk in R via install.packages("tcltk") .
  3. Now you are able to install the package zoo completely: install.packages("zoo") .

This should solve your problem.

In my case, the mirror should be selected first. So if you see "please select a cran mirror for use in this session", use chooseCRANmirror() . This works for me. The error only happens in the console, not in Rstudio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM