错误:CentOS 7上的软件包“ rstan”的延迟加载失败

时间:2020-07-23 14:09:57

标签: r centos7

我在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

    CXX14FLAGS = -O3

    CXX14PICFLAGS = -fpic

    CXX14STD = -std = gnu ++ 1y

  6. 按照here所述更新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

1 个答案:

答案 0 :(得分:0)

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

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

正在运行

install.packages("rstan")

然后成功运行完毕。

相关问题