在这篇文章指引下,成功安装,action!
pip install pyspider
结果报错
cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitPWhBWc.c -o tmp/xmlXPathInitPWhBWc.o
/tmp/xmlXPathInitPWhBWc.c:1:26: 错误:libxml/xpath.h:没有那个文件或目录
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9lw5M1/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-7OeKoX-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-9lw5M1/lxml/
导致安装出错的原因是libxml2和libxslt这两个库没有安装,而且找不到xslt-config这个可执行程序,解决方法如下:
# yum install libxml2
# yum install libxslt
# yum install libxslt-devel
安装成功