5

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 ?

J_F
  • 9,956
  • 2
  • 31
  • 55
ChiseledAbs
  • 1,963
  • 6
  • 19
  • 33
  • 1
    Have you installed that package? Here is the file listed you need to install `tcltk`https://www.archlinux.org/packages/extra/i686/tk/files/ – J_F Sep 23 '16 at 08:43
  • @J_F I installed the package tk and it worked, I was trying to install tcltk beforehand.. thanks ! – ChiseledAbs Sep 23 '16 at 08:58

2 Answers2

16

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.

Humza
  • 358
  • 1
  • 15
J_F
  • 9,956
  • 2
  • 31
  • 55
  • 1
    Are you sure with step 2? `tcltk` cannot be installed normally using `install.packages`: `Warning in install.packages : package ‘tcltk’ is not available (for R version 3.3.2) Warning in install.packages : package ‘tcltk’ is a base package, and should not be updated` – R Yoda Dec 14 '16 at 22:15
0

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.

Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
耿瀟奇
  • 21
  • 2