Package won't load in Rstudio (but does in R console)

Hello,

I have upgraded my MacOs to Ventura 13.3.1, then Xquartz, before installing R v4.3 (Intel) and associated Rstudio from the posit website. After package installation through the BiocManager tool, it looks that a few packages can't load including GenomicFeatures
Loading required package: GenomicFeatures
Loading required package: GenomicRanges
Error: package or namespace load failed for ‘GenomicRanges’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/XVector/libs/XVector.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/XVector/libs/XVector.so, 0x0006): Library not loaded: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libR.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/XVector/libs/XVector.so
Reason: tried: '/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libR.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file, not in dyld cache)
Failed with error: ‘package ‘GenomicRanges’ could not be loaded’

or

Biomart.
require(biomaRt)
Loading required package: biomaRt
Error: package or namespace load failed for ‘biomaRt’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Biobase/libs/Biobase.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Biobase/libs/Biobase.so, 0x0006): Library not loaded: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libR.dylib
Referenced from: <738286D7-58BA-3BDB-AE28-2C8F205EB910> /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Biobase/libs/Biobase.so
Reason: tried: '/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libR.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file, not in dyld cache)

The sessionInfo under Rstudio looks like:
R version 4.3.0 (2023-04-21)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.3.1

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

Any help to circumvent this issue would be great !
cheers,
G

1 Like

I am definitely not an expert but it seems strange to be accessing frameworks for both R 4.3 and R 4.2.

Fully agree but I can't find any explanation for this. It seems to be associated with a few packages only, and this is associated with the Xvector or Biobase dependencies.

I'm encounteering the same issue. I feel it may have something to do with the BLAS library, which is the only difference I can detect between the R console and Rstudio. I feel the BLAS Rstudio file path does not exist.

(in R console)
BLAS: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRblas.0.dylib

(in Rstudio)
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib

Same inconsistency but not sure how it contribues to the issue.

Since the problem appears to be with BioConductor packages, maybe try to update BiocManager first, then use it to update all these BioConductor packages (maybe with checkBuilt = TRUE).

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.