Search code examples
packagerstudioinstall.packages

"package or namespace load failed" error in loading R package "litteR"


i am getting the following error whenever i try to load the package "litteR". I have updated all my packages and dont have this problem with any other ones

library(litteR) xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Error: package or namespace load failed for ‘litteR’: .onLoad failed in loadNamespace() for 'tcltk', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/tcltk/libs/tcltk.so': dlopen(/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/tcltk/libs/tcltk.so, 0x000A): Library not loaded: /opt/X11/lib/libX11.6.dylib Referenced from: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/tcltk/libs/tcltk.so Reason: tried: '/opt/X11/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 '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1

im not sure why this is happening, i have a macbook pro, not sure if this makes a difference


Solution

  • You need to install the commando line tools. Open the Terminal.app and run the following line xcode-select --install