R devtools失败,因为“在pkg-config搜索路径中未找到软件包libxml-2.0”。 [英] R devtools fails as "Package libxml-2.0 was not found in the pkg-config search path"

查看:328
本文介绍了R devtools失败,因为“在pkg-config搜索路径中未找到软件包libxml-2.0”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在R版本3.2.1中安装devtools,但是当我这样做时会引发以下错误:

I am trying to install devtools in R version 3.2.1, however when I do the following error is thrown:

Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing libxml-2.0.pc
to the PKG_CONFIG_PATH environment variable

当我在终端中运行 dpkg -L libxml2-dev 时,我发现:

when I run dpkg -L libxml2-dev in a terminal I find:

/usr
/usr/bin
/usr/bin/xml2-config
/usr/share
/usr/share/aclocal
/usr/share/aclocal/libxml2.m4
/usr/share/doc
/usr/share/doc/libxml2-dev
/usr/share/doc/libxml2-dev/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/xml2-config.1.gz
/usr/share/man/man3
/usr/share/man/man3/libxml.3.gz
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libxml2.a
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/libxml-2.0.pc
/usr/lib/x86_64-linux-gnu/xml2Conf.sh
/usr/include
/usr/include/libxml2
/usr/include/libxml2/libxml
/usr/include/libxml2/libxml/globals.h
/usr/include/libxml2/libxml/schematron.h
/usr/include/libxml2/libxml/xlink.h
/usr/include/libxml2/libxml/HTMLparser.h
/usr/include/libxml2/libxml/pattern.h
/usr/include/libxml2/libxml/xmlexports.h
/usr/include/libxml2/libxml/xmlschemas.h
/usr/include/libxml2/libxml/list.h
/usr/include/libxml2/libxml/entities.h
/usr/include/libxml2/libxml/xmlstring.h
/usr/include/libxml2/libxml/encoding.h
/usr/include/libxml2/libxml/hash.h
/usr/include/libxml2/libxml/xmlmemory.h
/usr/include/libxml2/libxml/relaxng.h
/usr/include/libxml2/libxml/xmlsave.h
/usr/include/libxml2/libxml/SAX2.h
/usr/include/libxml2/libxml/xmlIO.h
/usr/include/libxml2/libxml/xmlschemastypes.h
/usr/include/libxml2/libxml/xpathInternals.h
/usr/include/libxml2/libxml/schemasInternals.h
/usr/include/libxml2/libxml/xmlmodule.h
/usr/include/libxml2/libxml/valid.h
/usr/include/libxml2/libxml/c14n.h
/usr/include/libxml2/libxml/xmlwriter.h
/usr/include/libxml2/libxml/tree.h
/usr/include/libxml2/libxml/xmlunicode.h
/usr/include/libxml2/libxml/nanohttp.h
/usr/include/libxml2/libxml/catalog.h
/usr/include/libxml2/libxml/xmlerror.h
/usr/include/libxml2/libxml/nanoftp.h
/usr/include/libxml2/libxml/xmlautomata.h
/usr/include/libxml2/libxml/xinclude.h
/usr/include/libxml2/libxml/HTMLtree.h
/usr/include/libxml2/libxml/chvalid.h
/usr/include/libxml2/libxml/parserInternals.h
/usr/include/libxml2/libxml/xpointer.h
/usr/include/libxml2/libxml/xmlversion.h
/usr/include/libxml2/libxml/dict.h
/usr/include/libxml2/libxml/xmlregexp.h
/usr/include/libxml2/libxml/DOCBparser.h
/usr/include/libxml2/libxml/parser.h
/usr/include/libxml2/libxml/xmlreader.h
/usr/include/libxml2/libxml/SAX.h
/usr/include/libxml2/libxml/threads.h
/usr/include/libxml2/libxml/debugXML.h
/usr/include/libxml2/libxml/xpath.h
/usr/include/libxml2/libxml/uri.h
/usr/share/doc/libxml2-dev/README
/usr/share/doc/libxml2-dev/NEWS.gz
/usr/share/doc/libxml2-dev/AUTHORS
/usr/share/doc/libxml2-dev/TODO.gz
/usr/share/doc/libxml2-dev/changelog.Debian.gz
/usr/lib/x86_64-linux-gnu/libxml2.so

尝试将其添加到我尝试过的 PKG_CONFIG_PATH 中: env PKG_CONFIG_PATH = / usr / lib / x86_64-linux-gnu / pkgconfig ,但这似乎不起作用。

to try and add this to the PKG_CONFIG_PATH I tried: env PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig however this does not seem to work.

推荐答案

好的,所以最后我不得不手动安装libxml2,即使我的系统说它已经拥有最新的版本安装后: sudo apt-get install libxml2 libxml2-dev

OK so in the end I had to manually install libxml2 even though my system said it allready had the most up to date version installed after: sudo apt-get install libxml2 libxml2-dev

我根据找到的信息手动安装了此处

I manually installed based on info found here:

wget ftp://xmlsoft.org/libxml2/libxml2-2.9.2.tar.gz

然后解压缩并移入文件夹:

then after unpacking and moving into the folder:

./configure --prefix=/usr --disable-static --with-history && make

sudo make install

之后,执行R命令 install。 package( devtools)成功完成。

after this the R command install.packages("devtools") completed with success.

这篇关于R devtools失败,因为“在pkg-config搜索路径中未找到软件包libxml-2.0”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆