gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 04:06:24 28 4
gpt4 key购买 nike

我正在尝试安装 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,然后重试。和以前一样,系统询问我要更新哪些软件包,我选择全部。这次我在尝试更新 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

第二次尝试后的 session 信息:

> 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() 失败?

最佳答案

我找到了一个稍微不同的解决方案。

  1. 以管理员身份打开 Rgui.exe。我认为您实际上不需要以管理员身份打开 Rgui.exe,但我这样做了,所以我将保留它。
  2. C:\...\R\win-library\3.5\rlang 移动到另一个文件夹(该目录中不保留 rlang 文件夹)
  3. install.packages("rlang")
  4. 关闭Rgui
  5. 开始新的(正常) session 并享受吧!

关于r - 安装开发版本的软件包时更新 rlang 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55803026/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com