5

我试图使用 install.packages('') 选项以及从源代码在 R 中安装 'pmml' 包。但是,双向都不断出错。

尝试从 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’

从源头尝试

> 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

尝试使用 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’

我也尝试使用这些相同的方法为 R 安装 xml 库,但不断收到类似的错误,例如

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

1 回答 1

7

您需要安装系统库libxm2-dev来安装XML包(pmml取决于它)。因此,如果您使用的是 Debian 或 Ubuntu,只需通过以下方式安装它:

sudo apt-get install libxml2-dev

然后继续安装 R 包。请仔细检查SystemRequirements您要安装的任何 R 包的主页中的部分(对于XML,请参见此处)。

于 2015-07-16T21:10:27.017 回答