Ubuntu 14.04 configure: error: "libxml not found"
Ubuntu 14.04 configure: error: "libxml not found"
尝试按如下方式安装 XML 包时出现错误 configure: error: "libxml not found"
。似乎 R 正在从 Anaconda 中获取 libxml2 安装。我该如何解决这个问题?
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
> install.packages("XML")
Installing package into ‘/home/bravegag/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/XML_3.98-1.19.tar.gz'
Content type 'application/x-gzip' length 1600788 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... /opt/dev/anaconda/2018.12/bin/xml2-config
USE_XML2 = yes
SED_EXTENDED_ARG: -E
Minor 9, Patch 8 for 2.9.8
Located parser file -I/opt/dev/anaconda/2018.12/include/libxml2 -I/opt/dev/anaconda/2018.12/include/parser.h
Checking for 1.8: -I/opt/dev/anaconda/2018.12/include/libxml2 -I/opt/dev/anaconda/2018.12/include
Using libxml2.*
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... no
checking for xmlParseFile in -lxml... no
configure: error: "libxml not found"
ERROR: configuration failed for package ‘XML’
* removing ‘/home/bravegag/R/x86_64-pc-linux-gnu-library/3.4/XML’
The downloaded source packages are in
‘/tmp/RtmpannHh6/downloaded_packages’
Warning message:
In install.packages("XML") :
installation of package ‘XML’ had non-zero exit status
>
我也明白了:
$ type xml2-config
xml2-config is /opt/dev/anaconda/2018.12/bin/xml2-config
但是在 R 环境中设置配置没有帮助:
Sys.setenv(XML_CONFIG="/opt/dev/anaconda/2018.12/bin/xml2-config")
更新 我已经在系统中安装了 libxml2 请参阅:
bravegag@zeus:~$ sudo apt-get install libxml2
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxml2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
bravegag@zeus:~$ sudo apt-get install libxml2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
确保您的系统安装了 libxml-dev
或 libxml2-dev
软件包。即
sudo apt-get install libxml2-dev
我无法确定哪个版本(libxml 或 libxml2)适合 14.04,但您需要确保安装了 -dev
版本。
我遇到了同样的错误,但 libxml2-dev
已经安装,所以没有帮助。
有用的是通过 conda 使用
安装 libxml
conda install r-xml
我觉得你用conda安装R的时候环境变量有问题
尝试按如下方式安装 XML 包时出现错误 configure: error: "libxml not found"
。似乎 R 正在从 Anaconda 中获取 libxml2 安装。我该如何解决这个问题?
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
> install.packages("XML")
Installing package into ‘/home/bravegag/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/XML_3.98-1.19.tar.gz'
Content type 'application/x-gzip' length 1600788 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... /opt/dev/anaconda/2018.12/bin/xml2-config
USE_XML2 = yes
SED_EXTENDED_ARG: -E
Minor 9, Patch 8 for 2.9.8
Located parser file -I/opt/dev/anaconda/2018.12/include/libxml2 -I/opt/dev/anaconda/2018.12/include/parser.h
Checking for 1.8: -I/opt/dev/anaconda/2018.12/include/libxml2 -I/opt/dev/anaconda/2018.12/include
Using libxml2.*
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... no
checking for xmlParseFile in -lxml... no
configure: error: "libxml not found"
ERROR: configuration failed for package ‘XML’
* removing ‘/home/bravegag/R/x86_64-pc-linux-gnu-library/3.4/XML’
The downloaded source packages are in
‘/tmp/RtmpannHh6/downloaded_packages’
Warning message:
In install.packages("XML") :
installation of package ‘XML’ had non-zero exit status
>
我也明白了:
$ type xml2-config
xml2-config is /opt/dev/anaconda/2018.12/bin/xml2-config
但是在 R 环境中设置配置没有帮助:
Sys.setenv(XML_CONFIG="/opt/dev/anaconda/2018.12/bin/xml2-config")
更新 我已经在系统中安装了 libxml2 请参阅:
bravegag@zeus:~$ sudo apt-get install libxml2
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxml2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
bravegag@zeus:~$ sudo apt-get install libxml2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
确保您的系统安装了 libxml-dev
或 libxml2-dev
软件包。即
sudo apt-get install libxml2-dev
我无法确定哪个版本(libxml 或 libxml2)适合 14.04,但您需要确保安装了 -dev
版本。
我遇到了同样的错误,但 libxml2-dev
已经安装,所以没有帮助。
有用的是通过 conda 使用
安装 libxmlconda install r-xml
我觉得你用conda安装R的时候环境变量有问题