[R-SIG-Mac] loading tcltk fails in R 4.2.1 on macOS

John Fox j|ox @end|ng |rom mcm@@ter@c@
Fri Sep 2 19:00:24 CEST 2022

Dear R-SIG-MAC list members,

Unless developer tools are installed, loading the standard tcltk package 
fails in R 4.2.1 on macOS because of the absence of otool:

------- snip -------

 > library(tcltk)
Error: package or namespace load failed for ‘tcltk’:
  .onLoad failed in loadNamespace() for 'tcltk', details:
   call: dyn.load(file, DLLpath = DLLpath, ...)
   error: unable to load shared object 
0x000A): Library not loaded: /opt/X11/lib/libX11.6.dylib
   Referenced from: 
   Reason: tried: '/opt/X11/lib/libX11.6.dylib' (no such file), 
'/usr/local/lib/libX11.6.dylib' (no such file), 
'/usr/lib/libX11.6.dylib' (no such file)
In addition: Warning message:
In system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE) :
   running command ''/usr/bin/otool' -L 
had status 1
xcode-select: note: no developer tools were found at 
'/Applications/Xcode.app', requesting install. Choose an option in the 
dialog to download the command line developer tools.

 > sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default

[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

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

loaded via a namespace (and not attached):
[1] compiler_4.2.1

------- snip -------

I discovered this issue when a user (cc'd above) wrote to me about 
having to install the macOS developer tools in order to use the Rcmdr 
package. I didn't encounter the problem myself because (of course) I 
have the developer tools installed. I was able to reproduce the problem 
by dusting off an old Mac without R installed and starting from scratch.

I believe that this issue has arisen before, e.g., on R 3.1.2; see 

Can this be fixed again in R-patched?

Thank you,

John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/

More information about the R-SIG-Mac mailing list