2012-12-12 95 views
6

我有這樣的問題:「非零退出狀態」 錯誤下載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’ 

AND:

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

嘗試:'install.packages(「RCurl」,contriburl =「http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.15/」)' –

+0

@TylerRinker他們'不使用Windows – Dason

+0

也請確保您已安裝libcurl。 RCurl依賴於curl,而XML依賴於RCurl。 – Zach

回答

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的過期版本。

+1

我認爲這可能是問題,我沒有進一步追求它,因爲當我檢查更新版本的R在控制檯中,它告訴我一切都是最新的。但是,謝謝 – soosus

0

安裝RCurl時出現過類似的問題。我所需要的軟件包在亞馬遜Linux上稱爲libcurl-devel,根據this post that answered my question,CentOS也是如此。它可以使用命令sudo yum install libcurl-devel進行安裝。如果您使用的是基於Debian的發行版,則該軟件包可能會有不同的名稱,並且將使用apt進行安裝。

您的XML lib問題可能有類似的解決方案。

2

運行過的CentOS 6.4,我剛剛成功地執行的步驟:

  1. 與Linux命令行安裝捲曲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) 
    

    希望這爲你節省一天!

    相關問題