r-错误:在CentOS 7上延迟加载包"rstan"失败



我在CentOS 7.8.2003上使用R 3.6.0。

我完成了以下步骤来安装rstan。

  1. sudo yum-install libv8 dev

  2. sudo yum-install libv8

  3. 制作目录~/.R和文件~/.R/Makevars

  4. 编辑~/.R/Makevars

  5. 添加以下

    CXX14=g++-fPIC

    cxx14标志=-O3

    CXX14PICFLAGS=-fpic

    CXX14STD=-std=gnu++1y

  6. 按照此处所述更新gcc。

  7. 在R:Sys.setenv(TZ="Etc/GMT-4"(中

  8. 在R:install.packages("rstan"(中

以结束

ar -rs ../inst/lib//libStanServices.a stan_fit.o stan_fit_base.o
ar: creating ../inst/lib//libStanServices.a
installing to /home/peter/R/00LOCK-rstan/00new/rstan/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
namespace ‘loo’ 2.2.0 is being loaded, but >= 2.3.0 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘rstan’
* removing ‘/home/peter/R/rstan’
The downloaded source packages are in
‘/tmp/RtmpZa6XF1/downloaded_packages’
Warning message:
In install.packages("rstan") :
installation of package ‘rstan’ had non-zero exit status

通过在R.中输入以下命令解决了问题

install.packages("loo",version="2.3.0")

重新运行

install.packages("rstan")

然后成功运行完成。

相关内容

最新更新