Difficulty installing readxl

Hi all. I am new to r. I have R studio version 1.3.1073 installed on my mac and I am trying to install readxl. I keep getting the following error message:

library(readxl)
Error: package or namespace load failed for ‘readxl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so, 6): Symbol not found: _EXTPTR_PTR
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so
Expected in: /Library/Frameworks/R.framework/Resources/lib/libR.dylib
in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so
In addition: Warning message:
package ‘readxl’ was built under R version 4.0.2
I have tried installing the package in a fresh session multiple times and uninstalling R studio and re-installing, but can't seem to get around the error message and am unable to import any excel files. Can anyone please help? Thanks in advance!

indicates

install.packages("Rcpp")

If you are offered the choice to install a later version from source, choose "No."

Thank you for the quick reply!

Unfortunately when I install Rcpp, I get a similar error message:

library(Rcpp)
Error: package or namespace load failed for ‘Rcpp’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so, 6): Symbol not found: _EXTPTR_PTR
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so
Expected in: /Library/Frameworks/R.framework/Resources/lib/libR.dylib
in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so
In addition: Warning message:
package ‘Rcpp’ was built under R version 4.0.2
Any thoughts?

It seems to be an issue with the CRAN version of Rcpp for MacOS systems, can you try installing this way?

install.packages("Rcpp", repos="https://rcppcore.github.io/drat")

This is the GitHub issue for reference

1 Like

Thank you very much I can confirm that this method has worked.

1 Like

This topic was automatically closed 7 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.