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