我目前正在尝试安装AnnotationHub,但我遇到了问题。我使用R 4.0.4、renv (版本0.15.4)和BiocVersion 3.12。
当我运行BiocManager::install("AnnotationHub")时,会得到以下错误:
Warning message:
This project is configured to use R version '4.1.1', but '4.0.4' is currently being used.
* installing *source* package ‘AnnotationHub’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
Error: package or namespace load failed for ‘AnnotationHub’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘Rcpp’ 1.0.6 is already loaded, but >= 1.0.7 is required
Error: loading failed
Execution halted我的.libPaths()看起来像这样:
[1] "/test_renv/renv/library/R-4.0/x86_64-pc-linux-gnu"
[2] "/usr/prog/R/4.0.4/lib64/R/library" 我认为错误消息非常直接,并重新安装了Rcpp (install.packages("Rcpp"))。然后我运行packageVersion("Rcpp"),它返回了1.0.8.3。我重新启动了我的R会话并重新运行了BiocManager::install("AnnotationHub"),但是发生了完全相同的错误消息。另外,如果我在安装library(Rcpp)之前运行AnnotationHub的话。
重新启动后运行sessionInfo()时,如下所示:
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas_haswellp-r0.2.20.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices datasets utils methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.4 tools_4.0.4 renv_0.15.4 我会非常感激任何的洞察力,为什么会发生这种情况,以及我如何能够修复它。
(我还在StackOverflow上发布了这个问题,因为我认为这不需要生物导体相关的问题)
发布于 2022-03-21 11:44:41
错误信息是非常简单的,是的,并且您的解决方案是正确的。但是很明显,在renv环境与标准install.packages和BiocManager::install的使用之间存在一个混合体。如果您需要一个具有特定版本的环境,那么请坚持使用renv::install等等来设置一个正确的锁文件。如果锁文件强制执行旧版本( Rcpp和/或其他包),尝试使用install.packages是没有意义的。否则,只需删除锁定文件或禁用环境。
https://stackoverflow.com/questions/71556554
复制相似问题