【发布时间】:2016-04-04 19:39:28
【问题描述】:
Python 菜鸟,请多多包涵。我使用了来自 www.python.org 的 v3.5.1 的 python 安装程序。我的意图是使用 Scrapy 运行一些脚本。
pip install scrapy 失败,easy_install scrapy 和其他人也是如此。我将错误追溯到 lxml 的错误安装。这是错误日志。我什至尝试过easy_installing libxml2,我不知道如何继续。
Building lxml version 3.5.0.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
src\lxml\includes\etree_defs.h(14): fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
Compile failed: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
xmlXPathInitck3f6zpk.c
C:\Users\Rohan\AppData\Local\Temp\easy_install-47utdost\lxml-3.5.0\temp\xmlXPathInitck3f6zpk.c(1): fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: Setup script exited with error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
【问题讨论】:
-
你尝试过使用 Python 3.4 吗?还是为 Windows lfd.uci.edu/~gohlke/pythonlibs 预构建数据包?或Anaconda distribution
-
这真是巧合。有人遇到了一个稍微类似的问题,我将他们指向 @furas 推荐 Christoph Golke 编译的 lxml。 see here
标签: python python-3.x scrapy lxml