Problem installing Bioconductor package AnnotationDbi on Mac OSX
1
0
Entering edit mode
cristian ▴ 10
@cristian-13977
Last seen 5.6 years ago

Hi,

I have posted this question on Biostars but it was suggested that this website is more appropriate: https://www.biostars.org/p/273228/#273242

I am having problems installing the Bioconductor package AnnotationDbi on my Mac OSX:

    biocLite('AnnotationDbi', ask = FALSE, lib = 'output/software/r/package/installation/')
    BioC_mirror: https://bioconductor.org
    Using Bioconductor 3.5 (BiocInstaller 1.26.1), R 3.4.0 (2017-04-21).
    Installing package(s) ‘AnnotationDbi’
    trying URL 'https://bioconductor.org/packages/3.5/bioc/src/contrib/AnnotationDbi_1.38.2.tar.gz'
    Content type 'application/x-gzip' length 4278787 bytes (4.1 MB)
    ==================================================
    downloaded 4.1 MB
    
    * installing *source* package ‘AnnotationDbi’ ...
    ** R
    ** inst
    ** preparing package for lazy loading
    Error in dyn.load(file, DLLpath = DLLpath, ...) :
      unable to load shared object '/Users/cr517/Documents/phd/project/output/software/r/package/installation/Rcpp/libs/Rcpp.so':
      dlopen(/Users/cr517/Documents/phd/project/output/software/r/package/installation/Rcpp/libs/Rcpp.so, 6): Library not loaded: @rpath/./libgfortran.3.dylib
      Referenced from: /Users/cr517/Documents/phd/project/output/software/r/package/installation/Rcpp/libs/Rcpp.so
      Reason: image not found
    ERROR: lazy loading failed for package ‘AnnotationDbi’
    * removing ‘/Users/cr517/Documents/phd/project/output/software/r/package/installation/AnnotationDbi’
    
    The downloaded source packages are in
        ‘/private/var/folders/z2/rt6qxntd3tg5bjmqlqnm0mdm0000gn/T/RtmpLXmGgy/downloaded_packages’
    Updating packages 'effects', 'multcomp'
    trying URL 'https://cran.rstudio.com/src/contrib/effects_4.0-0.tar.gz'
    Content type 'application/x-gzip' length 1282402 bytes (1.2 MB)
    ==================================================
    downloaded 1.2 MB
    
    trying URL 'https://cran.rstudio.com/src/contrib/multcomp_1.4-7.tar.gz'
    Content type 'application/x-gzip' length 607663 bytes (593 KB)
    ==================================================
    downloaded 593 KB
    
    * installing *source* package ‘effects’ ...
    ** package ‘effects’ successfully unpacked and MD5 sums checked
    ** R
    ** inst
    ** preparing package for lazy loading
    Error in dyn.load(file, DLLpath = DLLpath, ...) :
      unable to load shared object '/Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so':
      dlopen(/Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so, 6): Library not loaded: @rpath/./libgfortran.3.dylib
      Referenced from: /Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so
      Reason: image not found
    ERROR: lazy loading failed for package ‘effects’
    * removing ‘/usr/local/lib/R/3.4/site-library/effects’
    * restoring previous ‘/usr/local/lib/R/3.4/site-library/effects’
    * installing *source* package ‘multcomp’ ...
    ** package ‘multcomp’ successfully unpacked and MD5 sums checked
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** demo
    ** inst
    ** preparing package for lazy loading
    Error: package or namespace load failed for ‘survival’ in dyn.load(file, DLLpath = DLLpath, ...):
     unable to load shared object '/Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so':
      dlopen(/Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so, 6): Library not loaded: @rpath/./libgfortran.3.dylib
      Referenced from: /Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so
      Reason: image not found
    Error : package ‘survival’ could not be loaded
    ERROR: lazy loading failed for package ‘multcomp’
    * removing ‘/usr/local/lib/R/3.4/site-library/multcomp’
    * restoring previous ‘/usr/local/lib/R/3.4/site-library/multcomp’
    
    The downloaded source packages are in
        ‘/private/var/folders/z2/rt6qxntd3tg5bjmqlqnm0mdm0000gn/T/RtmpLXmGgy/downloaded_packages’
    Warning messages:
    1: In install.packages(pkgs = doing, lib = lib, ...) :
      installation of package ‘AnnotationDbi’ had non-zero exit status
    2: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
      installation of package ‘effects’ had non-zero exit status
    3: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
      installation of package ‘multcomp’ had non-zero exit status

It seems to start failing here:

    Error in dyn.load(file, DLLpath = DLLpath, ...) :
      unable to load shared object

I have copied my session info below:

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin16.5.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils   
[7] datasets  methods   base     

other attached packages:
[1] BiocInstaller_1.26.1 IRanges_2.10.3       S4Vectors_0.14.4   
[4] Biobase_2.36.2       graph_1.54.0         BiocGenerics_0.22.0
[7] rmarkdown_1.6        dplyr_0.7.3         

loaded via a namespace (and not attached):
[1] doBy_4.5-15         knitr_1.17          assertthat_0.2.0  
[4] evaluate_0.10.1     DBI_0.7             backports_1.1.0   
[7] withr_2.0.0         pkgconfig_2.0.1     devtools_1.13.3   
[10] bindr_0.1           rlang_0.1.2         rprojroot_1.2     
[13] Matrix_1.2-11       base64enc_0.1-3     stringr_1.2.0     
[16] memoise_1.1.0       magrittr_1.5        compiler_3.4.0    
[19] RColorBrewer_1.1-2  MASS_7.3-47         stringi_1.1.5     
[22] yaml_2.1.14         grid_3.4.0          tools_3.4.0       
[25] digest_0.6.12       bindrcpp_0.2        Rcpp_0.12.12      
[28] jsonlite_1.5        R6_2.2.2            htmltools_0.3.6   
[31] glue_1.1.1          BiocParallel_1.10.1 lattice_0.20-35   
[34] tibble_1.3.4        gtable_0.2.0

Could someone help me, please?

Thanks.

Best, C.

annotiondbi installation dyn.load error • 2.7k views
ADD COMMENT
0
Entering edit mode

This behaviour is interesting:

library(AnnotationDbi)
Error: package or namespace load failed for ‘AnnotationDbi’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/cr517/Documents/phd/project/output/software/r/package/installation/bit/libs/bit.so':
  dlopen(/Users/cr517/Documents/phd/project/output/software/r/package/installation/bit/libs/bit.so, 6): Library not loaded: @rpath/./libgfortran.3.dylib
  Referenced from: /Users/cr517/Documents/phd/project/output/software/r/package/installation/bit/libs/bit.so
  Reason: image not found
> .libPaths()
[1] "/Users/cr517/Documents/phd/project/output/software/r/package/installation"
[2] "/usr/local/lib/R/3.4/site-library"                                        
[3] "/usr/local/Cellar/r/3.4.0_1/R.framework/Versions/3.4/Resources/library"   
> library(AnnotationDbi, lib.loc = '/usr/local/lib/R/3.4/site-library/')

Attaching package: ‘AnnotationDbi’

The following object is masked from ‘package:dplyr’:

    select

It seems that AnnotationDbi is correctly installed in /usr/local/lib/R/3.4/site-library/ but R does not try to load it from there because it fails from loading it from /Users/cr517/Documents/phd/project/output/software/r/package/installation?

C.

ADD REPLY
0
Entering edit mode
@martin-morgan-1513
Last seen 6 weeks ago
United States

The first error is

Error in dyn.load(file, DLLpath = DLLpath, ...) :
      unable to load shared object '/Users/cr517/Documents/phd/project/output/software/r/package/installation/Rcpp/libs/Rcpp.so':
      dlopen(/Users/cr517/Documents/phd/project/output/software/r/package/installation/Rcpp/libs/Rcpp.so, 6): Library not loaded: @rpath/./libgfortran.3.dylib
      Referenced from: /Users/cr517/Documents/phd/project/output/software/r/package/installation/Rcpp/libs/Rcpp.so
      Reason: image not found
    ERROR: lazy loading failed for package ‘AnnotationDbi’
    * removing ‘/Users/cr517/Documents/phd/project/output/software/r/package/installation/AnnotationDbi’

and implies that Rcpp is installed incorrectly. Does

library(Rcpp)

succeed? What about updating .libPaths() 

mylib = /Users/cr517/Documents/phd/project/output/software/r/package/installation
.libPaths(mylib)

and then forgoing the lib= argument to biocLite()

biocLite("AnnotationDbi")

Make sure that each attempt is in a new R session.

 

ADD COMMENT
0
Entering edit mode

Hi Martin,

Thanks for your help.

library(Rccp) does not create an error.

My .libPaths() already contains the installation folder.

.libPaths()
[1] "/Users/cr517/Documents/phd/project/output/software/r/package/installation"
[2] "/usr/local/lib/R/3.4/site-library"                                        
[3] "/usr/local/Cellar/r/3.4.0_1/R.framework/Versions/3.4/Resources/library"

The installation still fails:

> biocLite('AnnotationDbi')
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.5 (BiocInstaller 1.26.1), R 3.4.0 (2017-04-21).
Installing package(s) ‘AnnotationDbi’
trying URL 'https://bioconductor.org/packages/3.5/bioc/src/contrib/AnnotationDbi_1.38.2.tar.gz'
Content type 'application/x-gzip' length 4278787 bytes (4.1 MB)
==================================================
downloaded 4.1 MB

* installing *source* package ‘AnnotationDbi’ ...
** R
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/Users/cr517/Documents/phd/project/output/software/r/package/installation/Rcpp/libs/Rcpp.so':
  dlopen(/Users/cr517/Documents/phd/project/output/software/r/package/installation/Rcpp/libs/Rcpp.so, 6): Library not loaded: @rpath/./libgfortran.3.dylib
  Referenced from: /Users/cr517/Documents/phd/project/output/software/r/package/installation/Rcpp/libs/Rcpp.so
  Reason: image not found
ERROR: lazy loading failed for package ‘AnnotationDbi’
* removing ‘/Users/cr517/Documents/phd/project/output/software/r/package/installation/AnnotationDbi’

The downloaded source packages are in
    ‘/private/var/folders/z2/rt6qxntd3tg5bjmqlqnm0mdm0000gn/T/RtmpLXmGgy/downloaded_packages’
Old packages: 'effects', 'multcomp'
Update all/some/none? [a/s/n]:
a
trying URL 'https://cran.rstudio.com/src/contrib/effects_4.0-0.tar.gz'
Content type 'application/x-gzip' length 1282402 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/src/contrib/multcomp_1.4-7.tar.gz'
Content type 'application/x-gzip' length 607663 bytes (593 KB)
==================================================
downloaded 593 KB

* installing *source* package ‘effects’ ...
** package ‘effects’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so':
  dlopen(/Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so, 6): Library not loaded: @rpath/./libgfortran.3.dylib
  Referenced from: /Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so
  Reason: image not found
ERROR: lazy loading failed for package ‘effects’
* removing ‘/usr/local/lib/R/3.4/site-library/effects’
* restoring previous ‘/usr/local/lib/R/3.4/site-library/effects’
* installing *source* package ‘multcomp’ ...
** package ‘multcomp’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
Error: package or namespace load failed for ‘survival’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so':
  dlopen(/Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so, 6): Library not loaded: @rpath/./libgfortran.3.dylib
  Referenced from: /Users/cr517/Documents/phd/project/output/software/r/package/installation/survival/libs/survival.so
  Reason: image not found
Error : package ‘survival’ could not be loaded
ERROR: lazy loading failed for package ‘multcomp’
* removing ‘/usr/local/lib/R/3.4/site-library/multcomp’
* restoring previous ‘/usr/local/lib/R/3.4/site-library/multcomp’

The downloaded source packages are in
    ‘/private/var/folders/z2/rt6qxntd3tg5bjmqlqnm0mdm0000gn/T/RtmpLXmGgy/downloaded_packages’
Warning messages:
1: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘AnnotationDbi’ had non-zero exit status

 

ADD REPLY
0
Entering edit mode

From your comment to the original question -- R looks in the first .libPaths(). It finds AnnotationDbi so tries to load. The load fails and R does not look further. If AnnotationDbi were not in the first .libPaths(), then it would have looked in the second, and then third.

My guess is that there are multiple versions of Rcpp (and other packages) installed, and some are corrupt. Can you discover the location of Rcpp installations

xx = installed.packages()
idx = xx[, "Package"] == "Rcpp"
sum(idx)
xx[idx, ]

and then in separate R sessions try and load each

library(Rcpp, lib.loc = ...)

If one loads and the other does not, I guess the solution will be to use the command remove.packages("Rcpp", lib=...) to remove the broken package.

ADD REPLY
0
Entering edit mode
> xx = installed.packages()
> idx = xx[, "Package"] == "Rcpp"
> sum(idx)
[1] 1
> xx[idx, ]
                                                     Package
                                                      "Rcpp"
                                                     LibPath
                         "/usr/local/lib/R/3.4/site-library"
                                                     Version
                                                   "0.12.12"
                                                    Priority
                                                          NA
                                                     Depends
                                              "R (>= 3.0.0)"
                                                     Imports
                                            "methods, utils"
                                                   LinkingTo
                                                          NA
                                                    Suggests
"RUnit, inline, rbenchmark, highlight, pkgKitten (>= 0.1.2)"
                                                    Enhances
                                                          NA
                                                     License
                                                "GPL (>= 2)"
                                             License_is_FOSS
                                                          NA
                                       License_restricts_use
                                                          NA
                                                     OS_type
                                                          NA
                                                      MD5sum
                                                          NA
                                            NeedsCompilation
                                                       "yes"
                                                       Built
                                                     "3.4.0"
> library(Rcpp, lib.loc = "/usr/local/lib/R/3.4/site-library")

But oddly enough, the following code does not throw a 'not found' error:

remove.packages('Rcpp', lib = "/usr/local/lib/R/3.4/site-library")
> library(Rcpp)

Well, actually, after closing and re-opening Rstudio, it does throw an error:

library(Rcpp)
Error in library(Rcpp) : there is no package called ‘Rcpp’

Let me reinstall it and reinstall AnnotationDbi.

 

ADD REPLY

Login before adding your answer.

Traffic: 821 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6