安装软件包的开发版本时更新rlang时出现问题

dkqlctbz  于 2023-06-03  发布在  其他
关注(0)|答案(2)|浏览(319)

我正在尝试安装tidyr的开发版本。当我尝试devtools::install_github("tidyverse/tidyr")remotes::install_github("tidyverse/tidyr")时,我得到以下错误:

> devtools::install_github("tidyverse/tidyr")
Downloading GitHub repo tidyverse/tidyr@master
Downloading GitHub repo r-lib/vctrs@master
These packages have more recent versions available.
Which would you like to update?

1:   All
2:   CRAN packages only
3:   None
4:   rlang    (0.3.4 -> 18856f22a...) [GitHub]
5:   ellipsis (0.1.0 -> 9908b24a2...) [GitHub]

Enter one or more numbers separated by spaces, or an empty line to cancel
1: 1
rlang    (0.3.4 -> 18856f22a...) [GitHub]
ellipsis (0.1.0 -> 9908b24a2...) [GitHub]
Downloading GitHub repo r-lib/rlang@master
√  checking for file 'C:\Users\owner\AppData\Local\Temp\RtmpYDrYNh\remotes96bc1c295445\r-lib-rlang-18856f2/DESCRIPTION' ...
-  preparing 'rlang': (2s)
√  checking DESCRIPTION meta-information ... 
-  cleaning src
-  installing the package to process help pages (1.3s)
-  cleaning src (27.6s)
-  checking for LF line-endings in source and make files and shell scripts (445ms)
-  checking for empty or unneeded directories (878ms)
-  building 'rlang_0.3.4.9002.tar.gz'

Installing package into ‘C:/Users/owner/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
ERROR: failed to lock directory 'C:/Users/owner/Documents/R/win-library/3.5' for modifying
Try removing 'C:/Users/owner/Documents/R/win-library/3.5/00LOCK-rlang'
In R CMD INSTALL
Error in i.p(...) : 
  (converted from warning) installation of package ‘C:/Users/owner/AppData/Local/Temp/RtmpYDrYNh/file96bc24b12ee3/rlang_0.3.4.9002.tar.gz’ had non-zero exit status

我按照警告的建议删除00LOCK-rlang,然后重试。和以前一样,我被问到要更新哪些包,我选择了All。这一次,当它尝试更新rlang时,我得到以下错误:

installing to C:/Users/owner/Documents/R/win-library/3.5/rlang/libs/x64
Error in file.copy(files, dest, overwrite = TRUE) : 
  (converted from warning) problem copying .\rlang.dll to C:\Users\owner\Documents\R\win-library\3.5\rlang\libs\x64\rlang.dll: Permission denied
* removing 'C:/Users/owner/Documents/R/win-library/3.5/rlang'
* restoring previous 'C:/Users/owner/Documents/R/win-library/3.5/rlang'
Error in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) : 
  (converted from warning) problem copying C:\Users\owner\Documents\R\win-library\3.5\00LOCK-rlang\rlang\libs\x64\rlang.dll to C:\Users\owner\Documents\R\win-library\3.5\rlang\libs\x64\rlang.dll: Permission denied
Execution halted
In R CMD INSTALL
Error in i.p(...) : 
  (converted from warning) installation of package ‘C:/Users/owner/AppData/Local/Temp/RtmpYDrYNh/file96bc74433a2d/rlang_0.3.4.9002.tar.gz’ had non-zero exit status

第二次尝试后的会话信息:

> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

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

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1        rstudioapi_0.10   magrittr_1.5      usethis_1.5.0     devtools_2.0.2    pkgload_1.0.2     R6_2.4.0          rlang_0.3.4       tools_3.5.2       pkgbuild_1.0.3   
[11] sessioninfo_1.1.1 cli_1.1.0         withr_2.1.2       remotes_2.0.4     yaml_2.2.0        assertthat_0.2.1  digest_0.6.18     rprojroot_1.3-2   crayon_1.3.4      processx_3.3.0   
[21] callr_3.2.0       fs_1.2.7          ps_1.3.0          curl_3.3          rpart_4.1-15      testthat_2.0.1    glue_1.3.1        memoise_1.1.0     compiler_3.5.2    desc_1.2.0       
[31] backports_1.1.4   prettyunits_1.0.2

使用source("https://install-github.me/r-lib/rlang")解决了这个问题,但为什么devtools::remotes::install_github()失败了?

zvokhttg

zvokhttg1#

我也经历过这个问题。注意[...]\rlang\libs\x64\rlang.dll: Permission denied。不允许当前R会话访问这些文件。要避免此问题,请通过Win+Q在Windows Search中搜索Rgui或通过C:\Program Files\R\R-3.5.3\bin\x64\Rgui.exe打开Rgui.exe。右键单击并按Run as administrator,然后执行与之前相同的操作。
您也可以在管理模式下运行RStudio。

aelbi1ox

aelbi1ox2#

我找到了一个稍微不同的解决方案。
1.以管理员身份打开Rgui.exe。我不认为你实际上需要打开Rgui.exe作为管理员,但我这样做了,所以我会离开它。
1.将C:\...\R\win-library\3.5\rlang移动到另一个文件夹(在该目录中不保留rlang文件夹)

  1. install.packages("rlang")
    1.关闭Rgui
    1.开始一个新的(正常)会话并享受!

相关问题