简体   繁体   English

无法在Ubuntu上为'pmml'安装'XML'包依赖

[英]unable to install 'XML' package dependency for 'pmml' on Ubuntu

I was trying to install the 'pmml' package in R using the install.packages('') option as well as from source. 我试图使用install.packages('')选项以及源代码在R中安装'pmml'软件包。 But keep getting errors both ways. 但是两种方式都会出错。

Trying from R 试试R

install.packages('pmml',dependencies=T)
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/home/PepperBoy/R/x86_64-pc-linux-gnu-library/3.2/XML’
ERROR: dependency ‘XML’ is not available for package ‘pmml’
* removing ‘/home/PepperBoy/R/x86_64-pc-linux-gnu-library/3.2/pmml’

Trying from source 从源头尝试

> install.packages('pmml_1.4.2.tar.gz', repos = NULL, type="source")
Installing package into ‘/home/PepperBoy/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
ERROR: dependency ‘XML’ is not available for package ‘pmml’
* removing ‘/home/PepperBoy/R/x86_64-pc-linux-gnu-library/3.2/pmml’
Warning message:
In install.packages("pmml_1.4.2.tar.gz", repos = NULL, type = "source") :
  installation of package ‘pmml_1.4.2.tar.gz’ had non-zero exit status

Trying using R CMD INSTALL 尝试使用R CMD安装

 % R CMD INSTALL pmml_1.4.2.tar.gz                         
* installing to library ‘/home/PepperBoy/R/x86_64-pc-linux-gnu-library/3.2’
ERROR: dependency ‘XML’ is not available for package ‘pmml’
* removing ‘/home/PepperBoy/R/x86_64-pc-linux-gnu-library/3.2/pmml’

I have also tried install the xml library for R using these same methods, but keep getting similar errors like 我也尝试使用这些相同的方法为R安装xml库,但不断得到类似的错误

ERROR: configuration failed for package ‘XML’
* removing ‘/home/PepperBoy/R/x86_64-pc-linux-gnu-library/3.2/XML’

You need to install the system library libxm2-dev to install the XML package (on which pmml depends). 您需要安装系统库libxm2-dev来安装XML包( pmml依赖的)。 So, if you are on Debian or Ubuntu, just install it through: 所以,如果您使用的是Debian或Ubuntu,只需通过以下方式安装:

sudo apt-get install libxml2-dev

and then proceed with the R packages installation. 然后继续R包安装。 Be careful to check the SystemRequirements section in the home page of any R package you want to install (for XML , see here ). 请注意检查要安装的任何R软件包的主页中的SystemRequirements部分(对于XML ,请参见此处 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM