R terra:由于00LOCK文件而无法更新,找不到锁定文件

7gyucuyw  于 2023-01-22  发布在  其他
关注(0)|答案(1)|浏览(265)

我正在尝试更新R-4.2.2中的terra包,但遇到了以下问题;

Warning message:
In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying C:\Users\xxxxx\Documents\R\win-library\4.2\00LOCK\terra\libs\x64\terra.dll 
to C:\Users\xxxxx\Documents\R\win-library\4.2\terra\libs\x64\terra.dll: Permission denied

已尝试使用install.packages("terra")install.packages('terra', repos='https://rspatial.r-universe.dev')install.packages('terra', repos='https://rspatial.r-universe.dev', INSTALL_opts = '--no-lock')-结果相同
根据许多建议,我已经去寻找00 LOCK文件删除它,然后再试一次,但它不存在的地方,我可以找到它。
我的问题的根源是dismo需要raster v3.5.21,并更新raster,使其符合terra下载的调用,这些错误。
‘package ‘raster’ 3.5.15 is loaded, but >= 3.5.21 is required by ‘dismo’’

> sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

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
noj0wjuj

noj0wjuj1#

关闭R(和R-Studio),并删除此文件夹:

C:\Users\xxxxx\Documents\R\win-library\4.2\terra

如果存在,也删除这些文件夹。

C:\Users\xxxxx\Documents\R\win-library\4.2\00LOCK-terra
C:\Users\xxxxx\Documents\R\win-library\4.2\00LOCK

然后打开R并安装“terra”

相关问题