Skip to content

[R-gui] tcltk troubleshooting on OS X

6 messages · Seth Frey, Adrian Waddell, Peter Dalgaard +1 more

#
Hello,

I have a strange problem with both R.app and RStudio.app.  Since it's
a problem with both, I figure it's a problem with R or with my system,
and that your expertises may offer some leads on how I can keep
isolating the problem.

I've made it this far: when I run either capabilities() or
library(tcltk), both GUI apps hang uninformatively and have to be
force quit.  On the command line (via OS X Terminal), R does fine:
"""
Warning message:
In fun(libname, pkgname) : couldn't connect to display ":0.0"
Error: could not find function "tcltk"
jpeg         png        tiff       tcltk         X11        aqua
       TRUE        TRUE        TRUE        TRUE       FALSE        TRUE
   http/ftp     sockets      libxml        fifo      cledit       iconv
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE
        NLS     profmem       cairo         ICU long.double     libcurl
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE
"""

So far, I've tried the following solutions:
Update R
Update RStudio
Downgrade RStudio (to version 0.98.1091 from Nov 2014)
And also,
     after removing all of following:
          /Library/Frameworks
          /Library/Frameworks/R.framework
          ~/Library/R
          ~/Applications/RStudio.app
          ~/Applications/R.app
          ~/.rstudio-desktop .rstudio-desktop.bak
          ~/.R
          ~/.Rapp.history
          ~/.Rhistory
          ~/.Rprofile
          and port uninstall R
     I tried installing R clean from https://cran.r-project.org/bin/macosx/
          and also removing it and installing R clean from Darwin
Ports with the +tcltk variant

After all this, I'm still getting the mysterious hang in both R.app
and RStudio.  I'm now out of guesses. I'm prepared to keep at it, but
at this point I don't even know where to start to continue chasing the
problem.

Thank you for your help.  If this isn't the right list to reach out
to, please let me know who to ask instead.

best,
seth.

ps. This isn't a problem with sqldf, but with a more obscure package,
mwa, so the standard workaround for tcltk problems,
options(gsubfn.engine = "R"), won't do. I need to be able to run:
"""
install.packages("mwa")
library(mwa)
example(matchedwake)
"""
This code should work fine on your machines (so it isn't a problem
with the developer of mwa), but it hangs on mine at "library(mwa)"
while loading required package tcltk.

pps., specs:
"""
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.4 (Yosemite)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_3.2.2
"""

best,
seth.
#
Hi Seth,

Have you installed XQuartz? See

https://cran.r-project.org/bin/macosx/ <https://cran.r-project.org/bin/macosx/>

Adrian

  
  
#
Adrian,
I'm not sure if I had or not, but I just installed it or reinstalled
it and reinstalled R on top of it.  That doesn't fix my problem,
RStudio.app and R.app both still hang.

In Terminal, capabilities is still showing X11 as FALSE.  Is that the
thing I should be trying to fix?  If tcltk depends on X11, why would
capabilities list it as TRUE if X11 is showing as FALSE?

Thanks again, and for the super quick reply.

best,
seth.
#
This may not bee too helpful but rather just increase your number of grey hairs (or cause you to pull them out...), but I see the following in RGui.app and Rstudio.app
jpeg         png        tiff       tcltk         X11        aqua    http/ftp     sockets      libxml        fifo      cledit 
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE 
      iconv         NLS     profmem       cairo         ICU long.double     libcurl 
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] tcltk     stats     graphics  grDevices utils     datasets  methods   base
One thing though: Beware of mixing build systems. If you are using macPorts, as it seems that you are, you may wind up with incompatible libraries.


-pd
On 28 Oct 2015, at 16:41 , Seth Frey <moctodliamg at gmail.com> wrote:

            

  
    
#
Check your DISPLAY env var -- it defines which X11 to connect to. In your command line you have apparently set it to :0.0 while you don't have even X11 running so it will fail unless you start X11 yourself. When you request X11, Apple has some additional magic it offers to start X11 automatically - I wonder if that is broken on your system so it just hangs. That magic will show up as a path in the DISPLAY variable instead of the regular display specification. If in doubt, start X11 by hand and set DISPLAY to :0.0.

Cheers,
Simon

PS: This would be more appropriate on SIG-Mac instead...
#
Thank you for all of the on- and off-list help.  The error came down
to an old old setting in my bash profile, totally unrelated to X11,
that was somehow crashing X11 anyway, which was in turn crashing the R
GUIs. Your leads helped me isolate it.  If something like this happens
again, I'll post to SIG-mac instead.

To be a bit more specific, the failure of X11 was hard-crashing R.app,
but it was only freezing RStudio.  With RStudio hanging on
capabilities(), for arbitrarily long, the act of opening XQuartz
caused RStudio to finish with capabilities() and print the right
output as if nothing had gone wrong.  Don't know if those are
interesting differences or not, but it might be, so worth sharing.

Thank you again for your help.

best,
seth.

Seth Frey
Neukom Postdoctoral Fellow
Dartmouth College
http://enfascination.com/research


On Thu, Oct 29, 2015 at 10:39 AM, Simon Urbanek
<simon.urbanek at r-project.org> wrote: