0
votes

I'm having problem with Caret package, Please see the error below,

library(caret)

Error: package or namespace load failed for ‘caret’ 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 ‘caret’ was built under R version 4.0.2

I am using macOS Catalina.

Thanks in advance, Daniel

2
Try update.packages(checkBuilt = TRUE).Roland
Still not working :(Daniel Ostrovsky
Have you recently updated R? Sometimes this happens with problematic updates... try using updateRcsgroen
I've just updated my R from CRAN, having problems with updateR as well :(Daniel Ostrovsky
Thanks all, I reinstalled and every thing is working nowDaniel Ostrovsky

2 Answers

0
votes

I had a similar issue when moving from 4.0 to 4.1 and reinstalling ggplot2 Basically when loading vctrs it was using the libR.dylib from the R.Framework 4.0 not the 4.1 (and I removed the 4.0)

>library(ggplot2)
       
Error: package or namespace load failed for ‘ggplot2’ in
     dyn.load(file, DLLpath = DLLpath, ...): unable to load shared 
object '/Users/xxxx/Library/R/4.1/library/vctrs/libs/vctrs.so':
           dlopen(/Users/xxxx/Library/R/4.1/library/vctrs/libs/vctrs.so, 6): 
Library not loaded: 
     /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
Referenced from: /Users/lgzdl/Library/R/4.1/library/vctrs/libs/vctrs.so
Reason: image not found

My temporary solution has been to duplicate the 4.1 and renamed it 4.0. At, least for now > library(vctrs) is not throwing an error! There must be a lingering reference to the R.Framework 4.0? somewhere?

-1
votes

I resolve this problem with latest release R-4.0.2.pkg in www.r-project.org -> Download -> CRAN and select your country.