I am getting warnings and empty popup boxes when compiling and loading R packages that depend on tk. They say that tk was not installed correctly.

I am using homebrew, but I can't tell which package might provide a correct install of tk, or if it would conflict with the existing (but broken) installation.

What is the recommended way to install enough of tk on OSX so that an R package with tk as a dependency (e.g. RNCEP) R will compile without giving this warning?


Here is the warning that I get when trying to load an R package that depends on tk.tcl:

Warning message:
In fun(libname, pkgname) :
  Can't find a usable tk.tcl in the following directories: 

/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tk8.5/Resources/Scripts /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5/Resources/Scripts ./lib/tk8.5 ./lib/tk8.5/Resources/Scripts ~/Library/Tcl/tk8.5 ~/Library/Tcl/tk8.5/Resources/Scripts /Library/Tcl/tk8.5 /Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/tk8.5 /System/Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/8.5/tk8.5 /System/Library/Tcl/8.5/tk8.5/Resources/Scripts ~/Library/Frameworks/tk8.5 ~/Library/Frameworks/tk8.5/Resources/Scripts /Library/Frameworks/tk8.5 /Library/Frameworks/tk8.5/Resources/Scripts /System/Library/Frameworks/tk8.5 /System/Library/Frameworks/tk8.5/Resources/Scripts ./library

  • 1
    Are you using a specific version of R? Does this article yield a workable R install? Are you asking an XY problem and really just looking to get R installed by bypassing a tk error or is getting a full tk part of the main goal?
    – bmike
    Mar 21, 2013 at 20:52
  • @bmike I've got a workable R install (installed as a .dmg downloaded from [Rstudio](www.rstudio.com), this is just giving me warnings and empty tk boxes). It started when I used brew to install inkscape and ghostscript (both of which require X11).
    – Abe
    Mar 21, 2013 at 21:06
  • Try installing R from homebrew - as the package writers should have sorted out issue
    – mmmmmm
    Mar 22, 2013 at 0:50
  • @Abe does your comment mean that you had a working R before you installed inkscape and ghostscript?
    – mmmmmm
    Mar 22, 2013 at 0:59
  • @Mark yes, it did work. Would it be a problem to overwrite the existing installation of R? Do I need to uninstall?
    – Abe
    Mar 22, 2013 at 1:48

1 Answer 1


Try installing tk from the ActiveState ActiveTcl binaries. If you're on Mavericks, make sure that you install ActiveTcl or greater, as there are some problems with earlier versions on Mavericks. Also, please note that ActiveTcl is not open-source software.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .