附加 rstan 包时出错:找不到入口点

Error attaching rstan package: Entry Point Not Found

我已经成功安装了 rstan,但是当我尝试用 library(rstan) 附加它时,我得到一个 pop-up window 标题为“RGui(64 位):Rgui.exe - 未找到入口点”和消息内容

The procedure entry point EXTPTR_PTR could not be located in the dynamic link library C:\Users\MyName\Documents\R\win-library.0\Rcpp\libs\x64\Rcpp.dll.

在 R 控制台本身我得到

> library(rstan)
Loading required package: StanHeaders
Loading required package: ggplot2
Error: package or namespace load failed for ‘rstan’ in inDL(x, as.logical(local), as.logical(now), ...):
 unable to load shared object 'C:/Users/Daniel/Documents/R/win-library/4.0/Rcpp/libs/x64/Rcpp.dll':
  LoadLibrary failure:  The specified procedure could not be found.

我是 运行 4.0.0 (2020-04-24) 'Arbor Day',在 64 位 Windows 机器上 Windows 10.

我认为这可能是 Rtools () 的问题,但重新安装了 rtools40 并将其正确添加到我的路径 - 然后重新安装 all of我的包以确保没有依赖性问题 - rstan 的问题仍然存在。知道这里可能出了什么问题,以及如何让 rstan 工作吗?

快速的:

  1. 您是自己从源代码构建的,还是安装了二进制文件?

  2. 您可能应该升级到 R 4.0.2,因为 4.0.0 和 4.0.1 存在已知问题。

  3. Rcpp 本身没有问题;它应该建立在 Windows 之上(请参阅 CRAN 检查页面)。

但是我们确实有很多关于 2 中问题的报告。所以请将 R 升级到 4.0.2 并尝试。

我们需要更新 R。在您的脚本中执行以下操作:

首先安装包

install.packages("installr")

然后:

library(installr)
updateR()

之后我们安装最后一个 R 更新。

这帮助我修复了 Can't load the library in Windows - EXTPTR_PTR could not be located in the dynamic library

的错误