解决problem copying rlang.dll: Permission denied的问题

本文详细介绍了在使用RStudio时遇到Permission Denied错误的具体场景及解决方案。错误发生在尝试下载特定包时,涉及到文件权限问题。文章提供了三步解决流程:删除锁定文件、以管理员身份运行RStudio并重启会话。

错误场景

在下载某些包 的时候,遇到了Permission denied的问题
错误如下:
In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying D:\Programme\R\R-3.6.1\R-3.6.1\library\00LOCK\rlang\libs\x64\rlang.dll to D:\Programme\R\R-3.6.1\R-3.6.1\library\rlang\libs\x64\rlang.dll: Permission denied

解决方案

原理是执行的权限不足,这里需要重置一下环境,并用管理员的方式打开。
分为三个步骤

1. unlink

unlink(“D:/Programme/R/R-3.6.1/R-3.6.1/library/00LOCK”, recursive = TRUE)

unlink("D:/Programme/R/R-3.6.1/R-3.6.1/library/00LOCK", recursive = TRUE)

如果不知道library的路径在哪里,可以看RStudio的Tools-Global Option-General- R version,举例如下。
查看设置

2.管理员方式打开

关闭r studio,已管理员的方式打开r studio,管理员权限很高。
管理员

3.重启一下R studio的session

重启session:ctrl+shift+F10(windows快捷键)
重启session:common+shift+F10(mac快捷键)
或者是R-studio通过Session-restart R的方式也可以。
restart session

ERROR: cannot remove earlier installation, is it in use? * removing 'C:/RRR/rlang' * restoring previous 'C:/RRR/rlang' Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) : problem copying C:\RRR\00LOCK-rlang\rlang\libs\x64\rlang.dll to C:\RRR\rlang\libs\x64\rlang.dll: Permission denied Warning in install.packages : installation of package ‘rlang’ had non-zero exit status * installing *source* package 'vctrs' ... ** package 'vctrs' successfully unpacked and MD5 sums checked ERROR: cannot remove earlier installation, is it in use? * removing 'C:/RRR/vctrs' * restoring previous 'C:/RRR/vctrs' Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) : problem copying C:\RRR\00LOCK-vctrs\vctrs\libs\x64\vctrs.dll to C:\RRR\vctrs\libs\x64\vctrs.dll: Permission denied Warning in install.packages : installation of package ‘vctrs’ had non-zero exit status * installing *source* package 'dbplyr' ... ** package 'dbplyr' successfully unpacked and MD5 sums checked ** using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace 'rlang' 1.1.0 is being loaded, but >= 1.1.1 is required Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace Execution halted ERROR: lazy loading failed for package 'dbplyr' * removing 'C:/RRR/dbplyr' Warning in install.packages : installation of package ‘dbplyr’ had non-zero exit status The downloaded source packages are in ‘C:\系统缓存\RtmpMrOhpA\downloaded_packages’
最新发布
06-07
评论 11
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值