0

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

UseR10085
  • 7,120
  • 3
  • 24
  • 54

2 Answers2

0

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?

DidierL
  • 26
  • 5
  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. – teunbrand Aug 27 '21 at 11:18
-1

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

pasqual.en
  • 21
  • 2