(R)尝试加载SQLDF包时发生错误 [英] (R) Error when trying to load the SQLDF package

查看:587
本文介绍了(R)尝试加载SQLDF包时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行以下代码时遇到了一些麻烦:

I have been having some trouble running the following code:

install.packages("sqldf",dep=TRUE)
library(sqldf)
install.packages("RSQLite",dep=TRUE)
library(RSQLite)

运行此命令后,我的目的是使用sqldf函数运行一些查询,但是我陷入了一个错误,我不确定如何解决,并且在堆栈溢出中找不到其他任何答案可能会有帮助.

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

然后我尝试运行:

install.packages("rlang")

但收到以下错误:

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)未更新,并且磁盘上的存储处于无法使用的部分状态(可能是其他状态).

Updating an already-installed package requires that R is able to unload the package. Typically this can be done easily, but often it can be problematic, specifically with packages that have compiled libraries (.so, .lib, or .dll, depending on the SO). I don't know the steps required to be able to disentangle shared objects like those, but it often just doesn't work. This can leave the updating process in a bad state: (1) not updated but still usable for this and current sessions; or (2) not updated and the on-disk store in a partial state that cannot be used (perhaps other states).

即使可以使用共享库更新软件包,唯一有保证的方法(尤其是在遇到问题的情况下)是将R重新启动到未加载该软件包的状态.如果要自动加载软件包(由于.Rprofile.Rdata),则需要确保在没有这些措施的情况下开始(也许是新项目"和/或将.Rprofile暂时移出).方式).

Even though it is possible to update packages with shared objects, the only guaranteed way (especially if you are experiencing problems) is to restart R into a state that does not have that package loaded. If you are auto-loading packages (due to .Rprofile or .Rdata), then you will need to make sure to start without those measures (perhaps a "new project" and/or move the .Rprofile temporarily out of the way).

所以...重新启动R并重新尝试安装/更新所有失败的软件包.

So ... restart R and re-attempt the install/update of all failed packages.

这篇关于(R)尝试加载SQLDF包时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆