[英]ERROR: lazy loading failed for package ‘rstan’ on CentOS 7
我在 CentOS 7.8.2003 上使用 R 3.6.0。
我通过以下步骤安装 rstan。
sudo yum 安装 libv8-dev
须藤百胜安装libv8
制作目录 ~/.R 和文件 ~/.R/Makevars
编辑 ~/.R/Makevars
添加以下内容
CXX14 = g++ -fPIC
CXX14FLAGS = -O3
CXX14PICFLAGS = -fpic
CXX14STD = -std=gnu++1y
如此处所述更新 gcc。
在 R 中: Sys.setenv( TZ="Etc/GMT-4" )
在 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")
然后成功运行完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.