ubuntu 下安装 lxml 失败

 

/tmp/pip-build-7HN4t8/lxml/src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory

 

/bin/python -c "import setuptools, tokenize;__file__=‘/tmp/pip-build-7HN4t8/lxml/setup.py‘;exec(compile(getattr(tokenize, ‘open‘, open)(__file__).read().replace(‘\r\n‘, ‘\n‘), __file__, ‘exec‘))" install --record /tmp/pip-LUVnYB-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/pycode/blogenv/include/site/python2.7/lxml" failed with error code 1 in /tmp/pip-build-7HN4t8/lxml

 

看了下安装文档

apt-get install libxml2-dev libxslt-dev python-dev

然后再次

pip install lxml

就成功了。

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。