1

[![ 你好呀!!

我在 Windows 10 操作系统上使用 R 4.0.5

我已经安装了 rtools40-x86_64 并使用以下命令将make it实用程序的位置按照此处的建议放置

writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")

但是,在重新启动 R 后,它给了我下图中的错误。或以下

Error: package or namespace load failed for ‘stats’ in inDL(x, as.logical(local), as.logical(now), ...):
 unable to load shared object 'C:/Program Files/R/R-4.0.5/library/stats/libs/x64/stats.dll':
  LoadLibrary failure:  The specified module could not be found.

During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found 
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'C:/Program Files/R/R-4.0.5/library/stats/libs/x64/stats.dll':
  LoadLibrary failure:  The specified module could not be found.

我已经卸载了 R、RStudio、Rtools,删除了 C、Documents 和 RStudio 注册表中的所有相关文件,然后重新安装。但同样的错误仍然存​​在。

在一篇相关的文章中,他们提到了丢失的二进制文件,我使用了命令

install.packages("stats", type = "binary")

但它是负面的。

我尝试更新 stats 包,但是一旦我调用它,它就会给出同样的错误。

> update.packages("stats")
> library(stats)
Error: package or namespace load failed for ‘stats’ in inDL(x, as.logical(local), as.logical(now), ...):
 unable to load shared object 'C:/Program Files/R/R-4.0.5/library/stats/libs/x64/stats.dll':
  LoadLibrary failure:  The specified module could not be found.

每个需要 stats 包的包都会给出完全相同的错误。

有谁知道如何克服这一挑战?

提前致谢。] 3 ] 3

4

3 回答 3

0

我在这里和其他地方看到了许多建议删除 .Renviron 文件。我在本地删除了 .Renviron 没有成功。但是,我在我的 OneDrive 文件夹中发现了另外两个 .Renviron 文件。

在 OneDrive 中删除这些文件并重新安装最新版本的 R 和 rtools 后,我能够避免“stats.dll”错误。

于 2022-01-25T19:36:46.113 回答
0

我已经安装了以前版本的 R (3.6.0) 和以前版本的 Rtools (.35),但该消息消失了。我还没有尝试过任何其他 R 版本。

于 2021-04-13T08:27:45.607 回答
-1

转到文件。删除.Renviron您创建的文件,它将起作用。

于 2021-04-30T03:08:03.550 回答