r - 在 conda 环境中将 rtracklayer 包从 Bioconductor 加载到 R 时,分段错误和内存未映射
问题描述
我创建了一个带有 r 和 bioconductor-rtracklayer 的 conda 环境:
conda create --name bioconductor-rtracklayer --channel conda-forge --channel bioconda --channel r --yes r=3.5.1 bioconductor-rtracklayer=1.42.1
并激活它:
conda activate bioconductor-rtracklayer
我正在开发 macOS High Sierra 10.13.3
然后我在终端中打开 R 并输入:
library(rtracklayer)
并得到以下错误:
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’:
anyDuplicated, append, as.data.frame, basename, cbind, colMeans,
colnames, colSums, dirname, do.call, duplicated, eval, evalq,
Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply,
lengths, Map, mapply, match, mget, order, paste, pmax, pmax.int,
pmin, pmin.int, Position, rank, rbind, Reduce, rowMeans, rownames,
rowSums, sapply, setdiff, sort, table, tapply, union, unique,
unsplit, which, which.max, which.min
Loading required package: S4Vectors
*** caught segfault ***
address 0x18, cause 'memory not mapped'
Traceback:
1: dyn.load(file, DLLpath = DLLpath, ...)
2: library.dynam(lib, package, package.lib)
3: loadNamespace(package, lib.loc)
4: doTryCatch(return(expr), name, parentenv, handler)
5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
6: tryCatchList(expr, classes, parentenv, handlers)
7: tryCatch({ attr(package, "LibPath") <- which.lib.loc ns <- loadNamespace(package, lib.loc) env <- attachNamespace(ns, pos = pos, deps)}, error = function(e) { P <- if (!is.null(cc <- conditionCall(e))) paste(" in", deparse(cc)[1L]) else "" msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), P, conditionMessage(e)) if (logical.return) message(paste("Error:", msg), domain = NA) else stop(msg, call. = FALSE, domain = NA)})
8: library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, quietly = quietly)
9: .getRequiredPackages2(pkgInfo, quietly = quietly)
10: library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, quietly = quietly)
11: .getRequiredPackages2(pkgInfo, quietly = quietly)
12: library(rtracklayer)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
我不明白问题是什么。可以请人帮助我吗?
请注意,我可以library(rtracklayer)
在 RStudio 中毫无问题地运行,并且可以成功使用包中的函数。为什么命令行和 RStudio 之间存在这种差异?
根据 Johannes Koester 的评论,我创建了一个 conda 环境并安装了 bioconductor-rtracklayer 而不指定 r 通道:
conda create --name bioconductor-rtracklayer --channel conda-forge --channel bioconda --yes r=3.5.1 bioconductor-rtracklayer=1.42.1
激活环境,在终端中打开 R 并输入library(rtracklayer)
,但我仍然收到以下错误:
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’:
anyDuplicated, append, as.data.frame, basename, cbind, colMeans,
colnames, colSums, dirname, do.call, duplicated, eval, evalq,
Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply,
lengths, Map, mapply, match, mget, order, paste, pmax, pmax.int,
pmin, pmin.int, Position, rank, rbind, Reduce, rowMeans, rownames,
rowSums, sapply, setdiff, sort, table, tapply, union, unique,
unsplit, which, which.max, which.min
Loading required package: S4Vectors
*** caught segfault ***
address 0x18, cause 'memory not mapped'
Traceback:
1: dyn.load(file, DLLpath = DLLpath, ...)
2: library.dynam(lib, package, package.lib)
3: loadNamespace(package, lib.loc)
4: doTryCatch(return(expr), name, parentenv, handler)
5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
6: tryCatchList(expr, classes, parentenv, handlers)
7: tryCatch({ attr(package, "LibPath") <- which.lib.loc ns <- loadNamespace(package, lib.loc) env <- attachNamespace(ns, pos = pos, deps)}, error = function(e) { P <- if (!is.null(cc <- conditionCall(e))) paste(" in", deparse(cc)[1L]) else "" msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), P, conditionMessage(e)) if (logical.return) message(paste("Error:", msg), domain = NA) else stop(msg, call. = FALSE, domain = NA)})
8: library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, quietly = quietly)
9: .getRequiredPackages2(pkgInfo, quietly = quietly)
10: library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, quietly = quietly)
11: .getRequiredPackages2(pkgInfo, quietly = quietly)
12: library(rtracklayer)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 1
R is aborting now ...
[1] 44550 segmentation fault R
请注意,我的 .libPaths() 包含:
.libPaths()
[1] "/Users/user/Library/R/3.5/library"
[2] "/Users/user/anaconda/envs/bioconductor-rtracklayer/lib/R/library"
我应该删除 R 内部的第一行.libPaths()
以在 conda 环境中获取 R 包吗?
但是,library(rtracklayer, lib.loc = '/Users/user/anaconda/envs/bioconductor-rtracklayer/lib/R/library')
给了我同样的错误。
解决方案
无需将 r 通道与 conda forge 和 bioconda 混合。它们甚至是二进制不兼容的。r 频道的所有软件包现在都在 conda-forge 中。请参阅http://bioconda.github.io了解正确的频道顺序和组合。希望这可能已经解决了错误。
推荐阅读
- c# - 如何在多个视图之间共享一个绑定值?
- powershell - 通过 SSH 将文件内容传输到远程文件
- laravel - Laravel 中的动态 url 路由
- javascript - 日期格式被插入数据库 + 4 小时
- swift - 不能对不可变值使用变异 getter:'self' 是不可变错误
- reactjs - 第 50 行:解析错误:未终止的 JSX 内容
- karate - 如何从 Java 读取 karate-config.js 中的变量
- python - 没有文件上传时如何修复 Flask 中的 UploadNotAllowed 错误?
- git - intelliJ and Bitbucket, where to start a project
- reactjs - 为什么会出现错误“组件正在将隐藏类型的受控输入更改为不受控制”?