下载scrapy出错,lxml报错

Error downloading scrapy, lxml error

  Failed building wheel for lxml
Failed to build lxml
Installing collected packages: lxml, scrapy
  Running setup.py install for lxml
    Complete output from command C:\Python34\python.exe -c "import setuptools, 
tokenize;__file__='C:\Users\Family\AppData\Local\Temp\pip-build-i6gpylsx\
lxml\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().
replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Family\AppData
\Local\Temp\pip-jggq15oq-record\install-record.txt --single-version-externally-managed --compile:
    Building lxml version 3.4.4.
    Building without Cython.
    ERROR: b'xslt-config \x84r inte ett internt kommando, externt kommando,\r\nprogram eller kommandofil.\r\n'
    ** make sure the development packages of libxml2 and libxslt are installed **

    Using build configuration of libxslt
    running install
    running build
    running build_py
    copying src\lxml\includes\lxml-version.h -> build\lib.win32-3.4\lxml\includes
    running build_ext
    building 'lxml.etree' extension
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo
 /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\Family\AppData\Local\Temp\pip-build-i6gpyl
sx\lxml\src\lxml\includes -IC:\Python34\include -IC:\Python34\include /Tcsrc\lxml\
lxml.etree.c /Fobuild\temp.win32-3.4\Release\src\lxml\lxml.etree.obj -w
    cl : Command line warning D9025 : overriding '/W3' with '/w'
    lxml.etree.c
    C:\Users\Family\AppData\Local\Temp\pip-build-i6gpylsx\lxml\src\lxml\includes\etree_defs.h(14) :
        fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
    C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\Python34\python.exe -c "import setuptools, tokenize;
__file__='C:\Users\Family\AppData\Local\Temp\pip-build-i6gpylsx\lxml\setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record C:\Users\Family\AppData\Local\Temp\pip-jggq15oq
-record\install-record.txt --single-version-externally-managed --compile" failed
 with error code 1 in C:\Users\Family\AppData\Local\Temp\pip-build-i6gpylsx\lxml

我在 64 位计算机上安装了 Python 3.4。在堆栈溢出上搜索了很多,但没有任何帮助。我不知道出了什么问题,你知道有什么解决办法吗?

Scrapy 目前不能与 Python 3 一起使用,但有计划(甚至正在进行中)做这个移植。因此,我建议您也将 Python 2.7 安装到您的计算机上,并在那里安装所需的库。

lxml 和其他库有一些 windows 的非官方端口,您可以查看 here.

有时您需要下载并安装一些免费的 Visual Studio 才能在您的 windows 机器上获取能够编译 lxml 的库。您可以在 SO here.

上找到相关问题