unable to install 'XML' package dependency for 'pmml' on Ubuntu
Asked Answered
C

1

5

I was trying to install the 'pmml' package in R using the install.packages('') option as well as from source. But keep getting errors both ways.

Trying from 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 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

ERROR: configuration failed for package ‘XML’
* removing ‘/home/PepperBoy/R/x86_64-pc-linux-gnu-library/3.2/XML’
Chercherbourg answered 16/7, 2015 at 20:41 Comment(5)
Are you on Ubuntu? If so, apt-get install libxml2-dev first and then try to reinstall from CRAN. You need to install the libxml2 library.Kennel
@nicola, This is fantastic. Worked. thanks If you could add this as an answer, would be nice.Chercherbourg
Glad it helped. Added an answer.Kennel
@nicola, ohh can't accept the answer. not enough reputation. Upvoted though. Will come back after a few days and accept the answer.Chercherbourg
Thank you very much. Actually you can accept (and you did indeed), but you can't upvote :)Kennel
K
8

You need to install the system library libxm2-dev to install the XML package (on which pmml depends). So, if you are on Debian or Ubuntu, just install it through:

sudo apt-get install libxml2-dev

and then proceed with the R packages installation. Be careful to check the SystemRequirements section in the home page of any R package you want to install (for XML, see here).

Kennel answered 16/7, 2015 at 21:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.