【发布时间】:2020-10-05 21:48:46
【问题描述】:
我正在尝试在 centOS 7 上为 Facebook 的 prophet 安装 R 库。为了便于重现,我提供了 dockerfile 和命令。
FROM centos:7
RUN yum -y install epel-release
RUN yum -y groupinstall "Development Tools"
RUN yum -y install proj
RUN yum -y install udunits2-devel
RUN yum -y install openssl-devel
RUN yum -y install libjpeg-turbo-devel
RUN yum -y install libcurl-devel
RUN yum -y install v8-devel
RUN yum -y install R
要构建 dockerfile,请使用以下命令。
docker build -t test_prophet_installation .
一旦构建完成,我就使用下一个命令运行容器。
docker run -it --entrypoint=/bin/bash test_prophet_installation
现在,我在我的容器中。我尝试使用以下命令安装prophet。
su - -c "R -e \"install.packages('prophet', repos='http://cran.rstudio.com/')\""
上面的命令说,prophet 的依赖项之一,即rstan 安装失败。所以我尝试使用以下命令安装“rstan”。
su - -c "R -e \"install.packages('rstan', repos='http://cran.rstudio.com/')\""
运行上述命令后,出现以下错误。
Error in .shlib_internal(args) :
C++14 standard requested but CXX14 is not defined
* removing '/usr/lib64/R/library/rstan'
The downloaded source packages are in
'/tmp/RtmpsPDQ9G/downloaded_packages'
Updating HTML index of packages in '.Library'
Warning messages:
1: In install.packages("rstan", repos = "http://cran.rstudio.com/") :
installation of package 'rstan' had non-zero exit status
2: In file.create(f.tg) :
cannot create file '/usr/share/doc/R-3.6.0/html/packages.html', reason 'No such file or directory'
3: In make.packages.html(.Library) : cannot update HTML package index
我尝试了几乎所有来自 Google 的故障排除来解决上述错误,但仍然没有成功。我想,我没有正确设置一些环境变量。
【问题讨论】:
-
看来实际问题是 rstan 没有安装。是对的吗?你检查过谁拥有那个文件夹吗?
标签: r docker centos facebook-prophet