前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >看起来全部的报错但是R包居然是安装并且成功加载

看起来全部的报错但是R包居然是安装并且成功加载

作者头像
生信技能树
发布2021-12-16 16:41:03
1.7K1
发布2021-12-16 16:41:03
举报
文章被收录于专栏:生信技能树生信技能树

给一个学员设置R语言安装以及R包环境,遇到了一个超级有意思的现象,首先呢,在中国大陆网络设置太难了,不出意外GitHub在线安装失败:

代码语言:javascript
复制
> if (!requireNamespace("UCell", quietly = TRUE)) {
+   devtools::install_github("carmonalab/UCell")
+ }


Downloading GitHub repo carmonalab/UCell@HEAD
Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
  cannot open URL 'https://api.github.com/repos/carmonalab/UCell/tarball/HEAD'

所以呢,我下载了这个包的GitHub包的压缩包文件网络传递给学生。

下载GitHub包的压缩包文件本地安装

前面的 install_github 命令,这个时候替换成 install_local 命令即可:

代码语言:javascript
复制
> install_local('carmonalab-UCell-v1.1-3-g968c780.tar.gz')

carmonalab-UCell-968c780/docs/index.html: Can't create '\\\\?\\C:\\Users\\win10\\AppData\\Local\\Temp\\RtmpYNih6v\\remotes1e44c219324fa\\carmonalab-UCell-968c780\\docs\\index.html'
tar.exe: Error exit delayed from previous errors.
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

不小心选择了更新一切~!

发现这个包的依赖不少啊:

代码语言:javascript
复制
Installing 42 packages: sitmo, RcppAnnoy, crayon, cli, glue, rlang, pillar, lifecycle, deldir, goftest, spatstat.geom, digest, cachem, bslib, later, R6, mime, httpuv, stringi, tibble, parallelly, RcppArmadillo, matrixStats, future, future.apply, cpp11, openssl, generics, data.table, crosstalk, tidyr, htmlwidgets, shiny, igraph, reticulate, spatstat.core, SeuratObject, plotly, pbapply, lmtest, fitdistrplus, Seurat

Warning: 正在使用‘data.table’, ‘SeuratObject’, ‘Seurat’这个程序包,因此不会被安装
将程序包安装入‘C:/Users/win10/Documents/R/win-library/4.1’
(因为‘lib’没有被指定)

尤其是:

代码语言:javascript
复制
有二进制版本的,但源代码版本是后来的:
                  binary     source needs_compilation
glue               1.4.2      1.5.0              TRUE
tibble             3.1.5      3.1.6              TRUE
RcppArmadillo 0.10.7.0.0 0.10.7.3.0              TRUE
cpp11              0.4.0      0.4.1             FALSE
crosstalk          1.1.1      1.2.0             FALSE
igraph             1.2.7      1.2.8              TRUE
spatstat.core      2.3-0      2.3-1              TRUE
lmtest            0.9-38     0.9-39              TRUE

然后就是满屏的报错:

代码语言:javascript
复制
* installing *source* package 'glue' ...
** package 'glue' successfully unpacked and MD5 sums checked
ERROR: cannot remove earlier installation, is it in use?
* removing 'C:/Users/win10/Documents/R/win-library/4.1/glue'
* restoring previous 'C:/Users/win10/Documents/R/win-library/4.1/glue'
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
  拷贝C:\Users\win10\Documents\R\win-library\4.1\00LOCK-glue\glue\libs\x64\glue.dll到C:\Users\win10\Documents\R\win-library\4.1\glue\libs\x64\glue.dll时出了问题:Permission denied 
* installing *source* package 'tibble' ...
** package 'tibble' successfully unpacked and MD5 sums checked
ERROR: cannot remove earlier installation, is it in use?
* removing 'C:/Users/win10/Documents/R/win-library/4.1/tibble'
* restoring previous 'C:/Users/win10/Documents/R/win-library/4.1/tibble'
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
  拷贝C:\Users\win10\Documents\R\win-library\4.1\00LOCK-tibble\tibble\libs\x64\tibble.dll到C:\Users\win10\Documents\R\win-library\4.1\tibble\libs\x64\tibble.dll时出了问题:Permission denied 
* installing *source* package 'RcppArmadillo' ...
** package 'RcppArmadillo' successfully unpacked and MD5 sums checked
** using staged installation

   **********************************************
   WARNING: this package has a configure script
         It probably needs manual configuration
   **********************************************

但是居然不影响它的成功安装和加载:

代码语言:javascript
复制
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path
* DONE (UCell)
There were 22 warnings (use warnings() to see them)
> library(UCell)
载入需要的程辑包:Matrix
> 

让我百思不得其解!

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-12-15,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 生信技能树 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 下载GitHub包的压缩包文件本地安装
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档