Cannot load any packages on Mac M1 OS X Monterey after updating R and Rstudio

Hi,
After updating R and Rstudio, I copy the whole R4.1 library to the R4.3 library.
And now I cannot load any packages, for example:

library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/glue/libs/glue.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/glue/libs/glue.so, 0x0006): tried: '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/glue/libs/glue.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))

I am confused as I am a medical student without complete programming skills.
Got no idea what should I do next?

This indicates that the pre-Silicon versions were found. If you have an M1 or later Mac and the 4.1 files were copied over from an Intel Mac, you would see this. If that is what happened there will be a lot of this to deal with. If it were me, I'd completely remove the R installation and start over again. You can try

install.packages("glue")

and it may work for this specific case, but I expect you will be seeing this a lot if you don't re-install.

1 Like

Thank you. It worths a try. :grinning:

1 Like

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.