零退出状态“错误下载XML和RCurl R软件包

我有这个问题:

> 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’

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

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


运行CentOS 6.4,我只是成功地按照以下步骤操作:

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

    希望这能为你节省一天!


    安装RCurl时,我遇到了类似的问题。 我需要的软件包在亚马逊Linux上称为libcurl-devel,根据这篇文章回答我的问题,CentOS也是如此。 它可以使用命令sudo yum install libcurl-devel 。 如果您使用的是基于Debian的发行版,则该软件包可能会有不同的名称,并且将使用apt进行安装。

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

    链接地址: http://www.djcxy.com/p/67209.html

    上一篇: zero exit status" error downloading XML and RCurl R packages

    下一篇: Is there a way NOT to capture $this in a PHP anonymous function?