繁体   English   中英

在 R 4.0.0 之前安装了包“xxx”:请重新安装(已经完成全新安装并检查了 lib 路径)

[英]Package 'xxx’ was installed before R 4.0.0: please re-install it (already done fresh install and checked lib paths)

我在从二进制文件安装 R 4.0.2 中的软件包时遇到了一些问题。 这是我的尝试:

> install.packages("C:/Users/MNestor/Downloads/libSBML_5.18.0.zip", repos = NULL, type = "win.binary")
Installing package into ‘C:/Users/MNestor/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)
package ‘libSBML’ successfully unpacked and MD5 sums checked
Warning messages:
1: multiple methods tables found for ‘type’ 
2: multiple methods tables found for ‘type<-’ 

接下来我加载库:

> library('libSBML')
Error: package or namespace load failed for ‘libSBML’:
 package ‘libSBML’ was installed before R 4.0.0: please re-install it

这个错误让我感到困惑,因为我在 R 4.0.2 中工作并且显然刚刚完成了全新安装。

我试过了

  1. 删除库文件夹并重新安装
  2. 运行remove.packages('libSBML')并重新安装

作为参考,这里是我的库目录:

> .libPaths()
[1] "C:/Users/MNestor/Documents/R/win-library/4.0"
[2] "C:/Program Files/R/R-4.0.2/library"   

libSMBL文件夹位于第一个库路径中,而不是第二个(如预期的那样)。

这是会话信息:

> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] rsbml_2.46.0        BiocGenerics_0.34.0

loaded via a namespace (and not attached):
[1] BiocManager_1.30.10 compiler_4.0.2      tools_4.0.2         remotes_2.2.0      
[5] stats4_4.0.2        SBMLR_1.84.0        graph_1.66.0  

错误消息可能有点令人困惑,但它表示该包已经为早期版本的 R 编译。(这就是选项“win.binary”的意思)。

由于更新的编译器和构建工具,R 4.0 和更早的二进制文件不兼容。

您需要从源代码安装软件包,这可能意味着安装 R 工具( https://cran.r-project.org/bin/windows/Rtools/ ),或者您需要使用预安装的版本为 R 4.0 或更高版本构建。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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