I installed the package geoR
via install.packages("geoR", dependencies = TRUE)
, which worked well. However, when loading it, I get
Error: package or namespace load failed for ‘geoR’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object'
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/tcltk/libs/t cltk.so, 10):
Library not loaded: /opt/X11/lib/libfontconfig.1.dylib
Referenced from: /usr/local/lib/libtk8.6.dylib
Reason: Incompatible library version: libtk8.6.dylib requires
version 11.0.0 or later, but libfontconfig.1.dylib provides version 10.0.0
I thought that I might need to update fontconfig, which I did using homebrew:
brew install fontconfig
I also re-linked it
brew unlink fontconfig && brew link fontconfig
Then, I checked the version
lorenz$ otool -L /usr/local/lib/libtk8.6.dylib /usr/local/lib/libtk8.6.dylib:
/usr/local/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.6)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
/opt/X11/lib/libXft.2.dylib (compatibility version 6.0.0, current version 6.2.0)
/opt/X11/lib/libfontconfig.1.dylib (compatibility version 11.0.0, current version 11.2.0)
/opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
/opt/X11/lib/libXss.1.dylib (compatibility version 2.0.0, current version 2.0.0)
/opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
This looks good to me. But even with a restart, the error persists. I found other questions here on SO like this but it did not help in my case.
Update
I also reinstalled R 3.4.4 (and hence the R package tcltk, which is a base package) but it did not help. I am running macOs High Sierra (10.12.6). I also reinstalled tcltk with homebrew. The installation succeeded, but I got the following message
This formula is keg-only, which means it was not symlinked into /usr/local,
because tk installs some X11 headers and macOS provides an (older) Tcl/Tk.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/tcl-tk/bin:$PATH"' >> ~/.bash_profile
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/tcl-tk/lib
CPPFLAGS: -I/usr/local/opt/tcl-tk/include
For pkg-config to find this software you may need to set:
PKG_CONFIG_PATH: /usr/local/opt/tcl-tk/lib/pkgconfig
So I am unsure what I have to do now.