简体   繁体   中英

Error installing R package: scran using Anaconda

I am using anaconda to download an R package called scran . Although I have download it to my R library path, I received error. When I try to load my package in my R environment, it also failed. I am on macOS Catalina (10.15.4). I also try BiocManager::install(scran) , but also failed.

scran ( https://bioconductor.org/packages/release/bioc/html/scran.html )

Can someone give me a hand? Really appreciated. Please see the details below.

# I download scran using conda install -c Bioconda bioconductor-scran

(scrnaseq) yaochung41@x86_64-apple-darwin13 library % conda install -c bioconda bioconductor-scran
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/yaochung41/anaconda3/envs/scrnaseq

  added / updated specs:
    - bioconductor-scran


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2020.4.5.1 |       hecc5488_0         146 KB  conda-forge
    certifi-2020.4.5.1         |   py38h32f6830_0         151 KB  conda-forge
    ------------------------------------------------------------
                                           Total:         297 KB

The following packages will be UPDATED:

  bioconductor-scran bioconda/label/cf201901::bioconductor~ --> bioconda::bioconductor-scran-1.14.1-r36h6de7cb9_0
  ca-certificates                     2019.11.28-hecc5488_0 --> 2020.4.5.1-hecc5488_0
  certifi                         2019.11.28-py38h32f6830_1 --> 2020.4.5.1-py38h32f6830_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
ca-certificates-2020 | 146 KB    | ##################################### | 100% 
certifi-2020.4.5.1   | 151 KB    | ##################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
INFO: deactivate-gfortran_osx-64.sh made the following environmental changes:
-DEBUG_FFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/yaochung41/anaconda3/envs/scrnaseq/include -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments
-DEBUG_FORTRANFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/yaochung41/anaconda3/envs/scrnaseq/include -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments
-F77=/Users/yaochung41/anaconda3/envs/scrnaseq/bin/x86_64-apple-darwin13.4.0-gfortran
-F90=/Users/yaochung41/anaconda3/envs/scrnaseq/bin/x86_64-apple-darwin13.4.0-gfortran
-F95=/Users/yaochung41/anaconda3/envs/scrnaseq/bin/x86_64-apple-darwin13.4.0-gfortran
-FC=/Users/yaochung41/anaconda3/envs/scrnaseq/bin/x86_64-apple-darwin13.4.0-gfortran
-FFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/yaochung41/anaconda3/envs/scrnaseq/include
-FORTRANFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/yaochung41/anaconda3/envs/scrnaseq/include
-GFORTRAN=/Users/yaochung41/anaconda3/envs/scrnaseq/bin/x86_64-apple-darwin13.4.0-gfortran
(scrnaseq) yaochung41@x86_64-apple-darwin13 library % R

# Then I try to load the package from R 3.6.3 using library(scran) , and I also received error

Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(scran)
Loading required package: SingleCellExperiment
Loading required package: SummarizedExperiment
Loading required package: GenomicRanges
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colnames, dirname, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
    pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table,
    tapply, union, unique, unsplit, which, which.max, which.min

Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

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

    expand.grid

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: DelayedArray
Loading required package: matrixStats

Attaching package: ‘matrixStats’

The following objects are masked from ‘package:Biobase’:

    anyMissing, rowMedians

Loading required package: BiocParallel

Attaching package: ‘DelayedArray’

The following objects are masked from ‘package:matrixStats’:

    colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges

The following objects are masked from ‘package:base’:

    aperm, apply, rowsum

Error: package or namespace load failed for ‘scran’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/yaochung41/anaconda3/envs/scrnaseq/lib/R/library/scran/libs/scran.dylib':
  dlopen(/Users/yaochung41/anaconda3/envs/scrnaseq/lib/R/library/scran/libs/scran.dylib, 6): Library not loaded: @rpath/libopenblasp-r0.3.7.dylib
  Referenced from: /Users/yaochung41/anaconda3/envs/scrnaseq/lib/R/library/scran/libs/scran.dylib
  Reason: image not found```


I had your exact second error you are experiencing today, and think I have found a fix.

After doing some digging, I found my problem was with openblas not SCRAN. My fix was:

$ conda install openblas=0.3.7

search for "libopenblasp-r0.3.7" in your files and copy it to the lib folder of your anaconda3 environment you are using, ie /Users/yaochung41/anaconda3/envs/scrnaseq/lib/:

$ find /home/username/ -name libopenblasp-r0.3.7
$ mv [PATH to libopenblasp-r0.3.7] /Users/yaochung41/anaconda3/envs/scrnaseq/lib/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM