#include "libxml/xmlversion.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
解决:
export C_INCLUDE_PATH=/usr/include/libxml2/
仍发生错误:
ERROR: /bin/sh: xslt-config: command not found
** make sure the development packages of libxml2 and libxslt are installed **
/tmp/pip-build-l1hWXy/lxml/src/lxml/includes/etree_defs.h:23:32: fatal error: libxslt/xsltconfig.h: No such file or directory
#include "libxslt/xsltconfig.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
解决:yum install libxslt-devel
再安装pip install lxml 或 scrapy 成功。
Successfully installed lxml-3.4.2 scrapy-0.24.5
本文解决了在安装lxml和scrapy过程中遇到的libxml2和libxslt开发包缺失问题,通过设置环境变量及使用包管理器安装依赖库最终完成安装。
557

被折叠的 条评论
为什么被折叠?



