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

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

> 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 命令即可:

> 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?

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

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

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’没有被指定)

尤其是:

有二进制版本的,但源代码版本是后来的:
 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

然后就是满屏的报错:

* 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
 **********************************************

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

** 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
>

让我百思不得其解!

Comments are closed.