【问题标题】:"Non-zero exit status" error downloading XML and RCurl R packages“非零退出状态”错误下载 XML 和 RCurl R 包
【发布时间】:2012-11-30 13:03:14
【问题描述】:

我遇到了这个问题:

> install.packages("RCurl")
Installing package(s) into ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/RCurl_1.95-3.tar.gz'
Content type 'application/x-gzip' length 868491 bytes (848 Kb)
opened URL
==================================================
downloaded 848 Kb

* installing *source* package ‘RCurl’ ...
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13/RCurl’
Warning in install.packages :
  installation of package 'RCurl' had non-zero exit status

The downloaded packages are in
    ‘/tmp/RtmpKyAgF8/downloaded_packages’

与:

> install.packages("XML")
Installing package(s) into ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/XML_3.95-0.1.tar.gz'
Content type 'application/x-gzip' length 1724282 bytes (1.6 Mb)
opened URL
==================================================
downloaded 1.6 Mb

* installing *source* package ‘XML’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
No ability to remove finalizers on externalptr objects in this verison of R
checking for sed... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13/XML’
Warning in install.packages :
  installation of package 'XML' had non-zero exit status

The downloaded packages are in
    ‘/tmp/RtmpKyAgF8/downloaded_packages’

【问题讨论】:

  • 试试:install.packages("RCurl", contriburl = "http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.15/")
  • @TylerRinker 他们没有使用 Windows
  • 还要确保你已经安装了 libcurl。 RCurl 依赖 curl,XML 依赖 RCurl。
  • 例如,试试这个sudo yum install curl curl-develsudo yum install libxml2 libxml2-devel

标签: xml r installation package rcurl


【解决方案1】:

您需要将 RCurl 和 XML 的版本与您正在使用的 R 版本相匹配。由于您的 R 版本比当前版本多一个主要版本,因此没有理由认为当前版本的 XML 和 Rcurl 会匹配。您可以尝试从它们的存档版本安装。我会从大约一年半前挑选一个.....或者只是更新你的 R 安装。

@TylerRinker 的链接中可能包含有用信息的内核,尽管它是针对错误操作系统的错误版本。如果您修剪 URL 并改为查看:http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.13/,您将能够确定在 redhat 上为您的过时版本的 R 使用哪个版本的源包。

【讨论】:

  • 我认为这可能是问题所在,但我没有进一步研究它,因为当我在控制台中检查 R 的较新版本时,它告诉我一切都是最新的。不过谢谢
【解决方案2】:

我在安装 RCurl 时遇到了类似的问题。包含我需要的软件包在 Amazon Linux 上称为 libcurl-devel,根据 this post that answered my question,CentOS 也是如此。它可以使用命令sudo yum install libcurl-devel 安装。如果您使用的是基于 Debian 的发行版,则该软件包可能具有不同的名称,并且将使用 apt 进行安装。

您的 XML lib 问题可能有类似的解决方案。

【讨论】:

    【解决方案3】:

    在 CentOS 6.4 上运行,我刚刚成功地按照以下步骤操作:

    1. 使用 Linux 命令行安装 curl-devel 和 libxml:
    $ sudo yum install curl curl-devel
    $ sudo yum -y install libxml2 libxml2-devel
    
    1. 在 R 控制台上,重新启动 R 会话并安装 RCurl 和 XML 包:
    >> install.packages("RCurl")
    >> install.packages("XML")
    
    1. 加载库:
    >> library(RCurl)
    >> library(XML)
    

    希望这可以为您节省一天的时间!

    【讨论】:

      【解决方案4】:

      在 Ubuntu 上安装 curl 和 xml。运行

      sudo apt-get install libcurl4-openssl-dev libxml2-dev
      

      在 R 中安装包的错误消息表明 curlxml 库不存在或找不到。

      【讨论】:

        猜你喜欢
        • 2014-01-07
        • 1970-01-01
        • 1970-01-01
        • 2016-11-25
        • 2019-10-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多