我使用以下命令
!pip install pyquery
我可以安装其他模块。有人知道为什么会这样吗?谢谢!
src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
Compile failed: command 'cc' failed with exit status 1
creating var
creating var/folders
creating var/folders/p1
creating var/folders/p1/xg17tts541n1__p_srg1n2j80000gn
creating var/folders/p1/xg17tts541n1__p_srg1n2j80000gn/T
cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /var/folders/p1/xg17tts541n1__p_srg1n2j80000gn/T/xmlXPathInit9XZ4sL.c -o var/folders/p1/xg17tts541n1__p_srg1n2j80000gn/T/xmlXPathInit9XZ4sL.o
/var/folders/p1/xg17tts541n1__p_srg1n2j80000gn/T/xmlXPathInit9XZ4sL.c:1:10: fatal error: 'libxml/xpath.h' file not found
#include "libxml/xpath.h"
^
1 error generated.
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
Perhaps try: xcode-select --install
*********************************************************************************
error: command 'cc' failed with exit status 1
----------------------------------------命令"/usr/bin/python -c“导入setuptools,tokenize;file='/private/var/folders/p1/xg17tts541n1__p_srg1n2j80000gn/T/pip-build-nn9QXj/lxml/setup.py';(编译(getattr(tokenize,'open',open)(file).read().replace('\r\n','\n'),文件,‘exec’)“安装-记录/var/folders/p1/xg17tts541n1__p_srg1n2j80000gn/T/pip-X97yGE-record/install-record.txt -单版本-外部管理-编译”失败,错误代码1在/private/var/folders/p1/xg17tts541n1__p_srg1n2j80000gn/T/pip-build-nn9QXj/lxml中
发布于 2015-11-16 04:27:52
基于这个参考http://forums.fedoraforum.org/showthread.php?t=297730,
我试着安装libffi,libxml2-devel,libxslt,它解决了这个问题。我使用的是CentOS 7。
发布于 2016-01-03 00:58:17
src/lxml/include/etree_defs.h:14:10:致命错误:'libxml/xmlversion.h‘文件未找到 包含"libxml/xmlversion.h“
我对这类错误进行了计数。在大多数情况下,安装共享库的开发包时,模块需要修复它。
在Debian中,libxml2-dev拥有libxml2 pacakge的所有头文件。libxml2 2:amd64 64/jessie 2.9.1+dfsg1-5最新版本libxml2-dev:amd64 64/jessie 2.9.1+dfsg1-5
lxml模块需要libxml2-dev和libxslt1-dev。
https://stackoverflow.com/questions/33702435
复制相似问题