r - (R) Error when trying to load the SQLDF package
问题描述
I have been having some trouble running the following code:
install.packages("sqldf",dep=TRUE)
library(sqldf)
install.packages("RSQLite",dep=TRUE)
library(RSQLite)
After running this, my intention is to use the sqldf function to run some queries, but I've gotten stuck on an error I'm not sure how to solve and I've had trouble finding any other answers on Stack Overflow that could be helpful.
The following is the error I receive after running the first line:
Loading required package: RSQLite
Error: package or namespace load failed for ‘RSQLite’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.4.0 is already loaded, but >= 0.4.2 is required
Error: package ‘RSQLite’ could not be loaded
I then tried running:
install.packages("rlang")
but received the following error:
package ‘rlang’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘rlang’
Warning in install.packages :
problem copying C:\Users\My Name\Documents\R\win-library\3.6\00LOCK\rlang\libs\x64\rlang.dll to C:\Users\My Name\Documents\R\win-library\3.6\rlang\libs\x64\rlang.dll: Permission denied
Warning in install.packages :
restored ‘rlang’
I am befuddled. Not sure how to begin addressing this issue. Any help or insight would be appreciated! Thank you!
解决方案
更新已安装的包需要 R 能够更新unload
该包。通常这可以很容易地完成,但通常可能会出现问题,特别是对于已编译库的包(.so
、.lib
或.dll
,取决于 SO)。我不知道能够解开这些共享对象所需的步骤,但它通常不起作用。这会使更新过程处于不良状态: (1) 未更新但仍可用于此会话和当前会话;或 (2) 未更新且磁盘存储处于无法使用的部分状态(可能是其他状态)。
即使可以使用共享对象更新包,唯一有保证的方法(特别是如果您遇到问题)是将 R 重新启动到没有加载该包的状态。如果您正在自动加载包(由于.Rprofile
or .Rdata
),那么您需要确保在没有这些措施的情况下开始(可能是“新项目”和/或.Rprofile
暂时移开)。
所以...重新启动 R 并重新尝试安装/更新所有失败的包。
推荐阅读
- java - 如果数据输入错误,如何创建对话框?
- c# - 通过远程会话将 Exchange 命令行管理程序与 C# 一起使用时防止反序列化
- python - 将 img 路径从客户端传递到服务器烧瓶
- c# - DocFx 无法在 Azure Pipelines 上加载 System.Buffers.dll
- python - 减法矩阵
- laravel - 在 AWS EC2 服务器上安装任何 Laravel 包都会显示警告和错误消息,即使 Globally 安装的 composer 版本是最新的
- php - Laravel / Eloquent:请求返回表中的 id 实例计数,然后将其存储到变量中
- android - mutableStateOf 在 MainActivity 中没有更新
- node.js - 当函数在 Node 中自行返回响应所需的时间太长时,如何返回被拒绝的承诺?
- visual-studio - Xamarin ios 远程构建错误(超时 + 错误 MT0018)