gpt4 book ai didi

R install.packages 返回 'ERROR: failed to lock directory'

转载 作者:行者123 更新时间:2023-12-04 12:36:09 26 4
gpt4 key购买 nike

[类似问题 14382209但建议没有解决这个问题]

R 4.0.0 和 tidyverse 的新安装在 Windows 7 工作计算机上返回此经典无法创建锁定目录错误

 install.packages('tidyverse')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘\\ukbia04sfsrv002.a04.dt21.svcs.hp.com/users/A04/ocarrib/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘highr’, ‘markdown’, ‘testthat’, ‘RColorBrewer’, ‘viridisLite’, ‘askpass’, ‘rematch’, ‘prettyunits’, ‘processx’, ‘knitr’, ‘yaml’, ‘htmltools’, ‘evaluate’, ‘base64enc’, ‘tinytex’, ‘xfun’, ‘backports’, ‘generics’, ‘reshape2’, ‘assertthat’, ‘glue’, ‘fansi’, ‘DBI’, ‘lifecycle’, ‘R6’, ‘tidyselect’, ‘ellipsis’, ‘pkgconfig’, ‘Rcpp’, ‘BH’, ‘plogr’, ‘digest’, ‘gtable’, ‘isoband’, ‘scales’, ‘withr’, ‘vctrs’, ‘curl’, ‘mime’, ‘openssl’, ‘utf8’, ‘clipr’, ‘cellranger’, ‘progress’, ‘callr’, ‘fs’, ‘rmarkdown’, ‘whisker’, ‘selectr’, ‘stringi’, ‘broom’, ‘cli’, ‘crayon’, ‘dbplyr’, ‘dplyr’, ‘forcats’, ‘ggplot2’, ‘haven’, ‘hms’, ‘httr’, ‘jsonlite’, ‘lubridate’, ‘magrittr’, ‘modelr’, ‘pillar’, ‘purrr’, ‘readr’, ‘readxl’, ‘reprex’, ‘rlang’, ‘rstudioapi’, ‘rvest’, ‘stringr’, ‘tibble’, ‘tidyr’, ‘xml2’


There are binary versions available but the source versions are later:
binary source needs_compilation
modelr 0.1.6 0.1.7 FALSE
xml2 1.3.1 1.3.2 TRUE

Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/highr_0.8.zip'
Content type 'application/zip' length 48579 bytes (47 KB)
downloaded 47 KB

# .... Output edited for brevity #

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyverse_1.3.0.zip'
Content type 'application/zip' length 440009 bytes (429 KB)
downloaded 429 KB

package ‘highr’ successfully unpacked and MD5 sums checked
Error in install.packages : ERROR: failed to lock directory ‘\\ukbia04sfsrv002.a04.dt21.svcs.hp.com\users\A04\ocarrib\R\win-library\4.0’ for modifying
Try removing ‘\\ukbia04sfsrv002.a04.dt21.svcs.hp.com\users\A04\ocarrib\R\win-library\4.0/00LOCK’

然后试用 rtools
 install.packages('rtools')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘\\ukbia04sfsrv002.a04.dt21.svcs.hp.com/users/A04/ocarrib/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rtools’ is not available (for R version 4.0.0)

然后试了一下:
- 删除 00lock直接来自指定位置的文件夹 (~A04\ocarrib\R\win-library\4.0/00LOCK)
- 重新启动 R
- 没有运气,同样的错误

然后试用选项:
> install.packages("tidyverse", dependencies = TRUE, INSTALL_opts = '--no-lock')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘\\ukbia04sfsrv002.a04.dt21.svcs.hp.com/users/A04/ocarrib/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘RColorBrewer’, ‘viridisLite’, ‘askpass’, ‘rematch’, ‘prettyunits’, ‘processx’, ‘lazyeval’, ‘backports’, ‘generics’, ‘reshape2’, ‘assertthat’, ‘fansi’, ‘DBI’, ‘lifecycle’, ‘R6’, ‘tidyselect’, ‘ellipsis’, ‘pkgconfig’, ‘Rcpp’, ‘BH’, ‘plogr’, ‘digest’, ‘gtable’, ‘isoband’, ‘scales’, ‘withr’, ‘vctrs’, ‘curl’, ‘mime’, ‘openssl’, ‘utf8’, ‘clipr’, ‘cellranger’, ‘progress’, ‘callr’, ‘fs’, ‘whisker’, ‘selectr’, ‘stringi’, ‘rex’, ‘yaml’, ‘evaluate’, ‘highr’, ‘markdown’, ‘xfun’, ‘htmltools’, ‘base64enc’, ‘tinytex’, ‘broom’, ‘cli’, ‘crayon’, ‘dbplyr’, ‘dplyr’, ‘forcats’, ‘ggplot2’, ‘haven’, ‘hms’, ‘httr’, ‘jsonlite’, ‘lubridate’, ‘magrittr’, ‘modelr’, ‘pillar’, ‘purrr’, ‘readr’, ‘readxl’, ‘reprex’, ‘rlang’, ‘rstudioapi’, ‘rvest’, ‘stringr’, ‘tibble’, ‘tidyr’, ‘xml2’, ‘covr’, ‘feather’, ‘glue’, ‘knitr’, ‘rmarkdown’, ‘testthat’


There are binary versions available but the source versions are later:
binary source needs_compilation
modelr 0.1.6 0.1.7 FALSE
xml2 1.3.1 1.3.2 TRUE

Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/RColorBrewer_1.1-2.zip'
Content type 'application/zip' length 55583 bytes (54 KB)
downloaded 54 KB

# Output edited for brevity

package ‘RColorBrewer’ successfully unpacked and MD5 sums checked
package ‘viridisLite’ successfully unpacked and MD5 sums checked
package ‘askpass’ successfully unpacked and MD5 sums checked
Error in install.packages : ERROR: failed to lock directory ‘\\ukbia04sfsrv002.a04.dt21.svcs.hp.com\users\A04\ocarrib\R\win-library\4.0’ for modifying
Try removing ‘\\ukbia04sfsrv002.a04.dt21.svcs.hp.com\users\A04\ocarrib\R\win-library\4.0/00LOCK’

还有其他想法吗??

session 信息:
> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

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

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

loaded via a namespace (and not attached):
[1] compiler_4.0.0 tools_4.0.0

最佳答案

  • 打开 R文件夹(下载后首先保存 R 的位置)
  • 删除 00lock文件夹通过更改其位置 - 剪切并粘贴到另一个位置。
  • 尝试下载库。
  • 关于R install.packages 返回 'ERROR: failed to lock directory',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61545327/

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