无法在CentOS的R中安装XML软件包

马尔辛·科辛斯基

当我尝试xml在CENTOS上的R中安装软件包时,收到以下警告:

> install.packages("XML")
Installing package into ‘/opt/wpusers/r-mkosinski/R/x86_64-redhat-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/XML_3.98-1.1.tar.gz'
Content type 'application/x-gzip' length 1582216 bytes (1.5 Mb)
opened URL
==================================================
downloaded 1.5 Mb

* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... 
rm: cannot remove 'a.out.dSYM': Is a directory
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
checking for sed... /usr/bin/sed
checking for pkg-config... /bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/opt/wpusers/r-mkosinski/R/x86_64-redhat-linux-gnu-library/3.1/XML’
Warning in install.packages :
  installation of package ‘XML’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp3rqP3n/downloaded_packages’

>

我的会话信息是:

> session_info()
Session info --------------------------------------------------------------------
 setting  value                       
 version  R version 3.1.2 (2014-10-31)
 system   x86_64, linux-gnu           
 ui       RStudio (0.98.1091)         
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       Europe/Warsaw               

Packages ------------------------------------------------------------------------
 package    * version   date       source                            
 archivist    1.2       2015-02-12 Github (pbiecek/archivist@d5305be)
 assertthat * 0.1       2013-12-06 CRAN (R 3.1.2)                    
 bitops     * 1.0-6     2013-08-17 CRAN (R 3.1.2)                    
 DBI          0.3.1     2014-09-24 CRAN (R 3.1.2)                    
 devtools     1.7.0     2015-01-17 CRAN (R 3.1.2)                    
 digest     * 0.6.8     2014-12-31 CRAN (R 3.1.2)                    
 dplyr        0.4.0     2015-01-08 CRAN (R 3.1.2)                    
 htmltools  * 0.2.6     2014-09-08 CRAN (R 3.1.2)                    
 httpuv     * 1.3.2     2014-10-23 CRAN (R 3.1.2)                    
 httr       * 0.6.1     2015-01-01 CRAN (R 3.1.2)                    
 lubridate    1.3.3     2013-12-31 CRAN (R 3.1.2)                    
 magrittr   * 1.5       2014-11-22 CRAN (R 3.1.2)                    
 memoise    * 0.2.1     2014-04-22 CRAN (R 3.1.2)                    
 mime       * 0.2       2014-09-26 CRAN (R 3.1.2)                    
 pbapply      1.1-1     2014-05-16 CRAN (R 3.1.2)                    
 plyr       * 1.8.1     2014-02-26 CRAN (R 3.1.2)                    
 R6         * 2.0.1     2014-10-29 CRAN (R 3.1.2)                    
 Rcpp       * 0.11.3    2014-09-29 CRAN (R 3.1.2)                    
 RCurl      * 1.95-4.5  2014-12-28 CRAN (R 3.1.2)                    
 RJSONIO    * 1.3-0     2014-07-28 CRAN (R 3.1.2)                    
 RSQLite      1.0.0     2014-10-25 CRAN (R 3.1.2)                    
 rstudio    * 0.98.1091 2015-01-19 local                             
 rstudioapi * 0.2       2014-12-31 CRAN (R 3.1.2)                    
 shiny        0.10.2.2  2014-12-08 CRAN (R 3.1.2)                    
 stringi      0.4-1     2014-12-14 CRAN (R 3.1.2)                    
 stringr    * 0.6.2     2012-12-06 CRAN (R 3.1.2)                    
 xtable     * 1.7-4     2014-09-12 CRAN (R 3.1.2) 

也许这是R版本的问题?

德克·埃德比布特尔

您在输出中明确指出了两个问题:

  1. 首先是警告,您可能要删除a.out/
checking for C compiler default output file name... 
rm: cannot remove 'a.out.dSYM': Is a directory
a.out
checking whether the C compiler works... yes
  1. 第二个是错误,是您的交易突破者-您没有安装libxml2-dev(或任何CentOS称呼它的):
checking for xml2-config... no
Cannot find xml2-config

没有libxml2-dev提供的XML开发工具,根本无法从源代码构建程序包。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章