【问题标题】:Error in gdata::installXLSXsupport() on Docker Centos 7Docker Centos 7 上的 gdata::installXLSXsupport() 错误
【发布时间】:2017-10-30 21:19:54
【问题描述】:

我尝试在 Docker 映像中的 Centos7 上安装支持 XLSX 的 gdata 包。运行命令 gdata::installXLSXsupport() 失败。

我的 Dockerfile 如下所示:

FROM centos:latest

RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum install -y R
RUN yum install -y libcurl-devel
RUN yum install -y openssl-devel
RUN yum install -y libssh2-devel
RUN yum install -y libxml2-devel


RUN yum install -y perl-CPAN
RUN R -e "install.packages('gdata', repos='https://cran.rstudio.com/')"
RUN R -e "gdata::installXLSXsupport()"

构建过程在最后一步崩溃并显示消息:

Step 10/10 : RUN R -e "gdata::installXLSXsupport()"
 ---> Running in 4e15bdcd2422

R version 3.3.3 (2017-03-06) -- "Another Canoe"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> gdata::installXLSXsupport()
Attempting to create directory /root/perl5
Warning: prerequisite Test::More 0 not found.
Tried to deactivate inactive local::lib '/root/perl5'
Use of uninitialized value $deactivating in numeric eq (==) at /usr/share/perl5/vendor_perl/local/lib.pm line 381.
Use of uninitialized value $deactivating in numeric eq (==) at /usr/share/perl5/vendor_perl/local/lib.pm line 383.
Use of uninitialized value $options{"interpolate"} in numeric eq (==) at /usr/share/perl5/vendor_perl/local/lib.pm line 424.
Use of uninitialized value $options{"interpolate"} in numeric eq (==) at /usr/share/perl5/vendor_perl/local/lib.pm line 424.
Use of uninitialized value $options{"interpolate"} in numeric eq (==) at /usr/share/perl5/vendor_perl/local/lib.pm line 424.
Use of uninitialized value $_[0] in substitution (s///) at /usr/share/perl5/File/Basename.pm line 341.
fileparse(): need a valid pathname at /usr/share/perl5/CPAN/FirstTime.pm line 1354.
Error in gdata::installXLSXsupport() :
Unable to install Perl XLSX support libraries.

In addition: Warning message:
running command ''/usr/bin/perl' '/usr/lib64/R/library/gdata/perl/install_modules.pl'' had status 255
Execution halted
The command '/bin/sh -c R -e "gdata::installXLSXsupport()"' returned a non-zero code: 1

这个问题的原因可能是什么?

【问题讨论】:

    标签: r perl docker centos7 gdata


    【解决方案1】:

    gdata::installXLSXsupport() --

    此函数调用位于 gdata 包目录的 perl 子目录(或 inst/perl in 源包)。这个 perl 脚本尝试使用 perl 'CPAN' 包,应该作为大多数 perl 安装的一部分包含在内, 自动下载、编译和安装 Compress::Raw::Zlib 和 Spreadsheet::XLSX perl 模块需要 读取.xls

    有时使用 CPAN 太痛苦了。

    尝试将RUN R -e "gdata::installXLSXsupport()"替换为

    yum install -y perl-Compress-Raw-Zlib perl-Spreadsheet-XLSX

    【讨论】:

    • 谢谢。不幸的是它不起作用(仍然显示加载 gdata 时的消息)。正如你所引用的,奇怪的是,文档说这就是这个函数正在做的事情。我已经尝试在安装包之前安装它(这样它可能会在包安装过程中以某种方式使用),但它也不起作用。但是,安装时,“RUN R -e "gdata::installXLSXsupport()”返回的错误,更改为“gdata::installXLSXsupport() 中的错误:无法安装 Perl XLSX 支持库。执行停止”。
    猜你喜欢
    • 2015-06-05
    • 1970-01-01
    • 2014-12-15
    • 2016-05-09
    • 1970-01-01
    • 1970-01-01
    • 2018-12-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多