Library confusion after update to V2022.12.0+353 on Mac

After updating RStudio I am receiving the following message when trying to load packages. The error below is specific to ggplot2 but the same thing happens no matter what package I'm trying to load.

Error: package or namespace load failed for ‘ggplot2’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/barrylesht/Library/R/x86_64/4.2/library/glue/libs/glue.so':
dlopen(/Users/barrylesht/Library/R/x86_64/4.2/library/glue/libs/glue.so, 0x0006): Library not loaded: '/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib'
Referenced from: '/Users/barrylesht/Library/R/x86_64/4.2/library/glue/libs/glue.so'
Reason: tried: '/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file)

For some reason RStudio seems to be trying the 4.0 library instead of the 4.2 library. How can I fix this?

This arises from installationsof R—one under the user /Users/barrylesht/Library, which can happen with non-standard installations from brew or anaconda, for example, rather than the root /Library. Check to see if you have an installation under root and, if so, uninstall the User version. See if that works; if not try adjusting $PATH variable. Otherwise, download from CRAN and re-install, taking all the defaults.

Thanks, I appreciate your help, but I'm still confused. I don't use either brew or anaconda, rather used the installer downloaded from the "Posit" site. I just reinstalled both R and RStudio. However, here is what I see in the /Applications directory:

drwxr-xr-x 3 root wheel 96 Dec 19 14:11 R.app
drwxr-xr-x@ 3 barrylesht admin 96 Dec 3 21:28 RStudio.app

I'm not sure what you mean by adjusting the $PATH variable.

What you are seeing is in the Applications folder and relates to the RStudio GUI, only. LAPACK is part of R which isn't installed there but in Library/Frameworks/R.framework/Versions/4.0/Resources/lib/ , /usr/local/lib/libR.dylib' or '/usr/lib/libR.dylib. Could you have installed an x86_64 on a Silicon box? And if $PATH is not familiar, I'd advise against trying to follow the ln procedure above. It's easy to trip up.

Following your advice to another user with (what looks to me like) a similar problem, I did this:

sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.6.2

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

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] stats graphics grDevices utils datasets methods base

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

My Macbook processor is Intel.

I'm dead in the water until I get this fixed so I just restored the previous version or RStudio (the base R version is the same) and it works fine. Something must have gone wrong with the RStudio update. I hope we can figure that out.

1 Like

Sorry for the confusion—I think that I conflated the two questions. Don't forget about the cloud version. I also have RStudio Server installed locally for use with tablets and situations like these.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.