在 Scrapy 安装期间无法在库 libxml2 中找到函数 xmlCheckVersion

Could not find function xmlCheckVersion in library libxml2 during Scrapy install

我一直在无数论坛中寻找解决方案,但我仍然没有找到有效的答案。我是 windows 的新手,我正在尝试按照我在 Mac 上的设置进行设置,但是命令行出现了挑战(什么等同于 sudo?)例如,在 mac 我会输入 'sudo pip install scrapy',windows 的等价物是什么?我在下面收到此错误,但似乎无法找到解决方法。非常感谢任何想法。

  C:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc\lxml\includes -Ic:\python27\include -Ic:\python27\PC /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win32-2.7\Release\src\lxml\lxml.etree.obj -w
    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:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
    creating users
    creating users\kenma
    creating users\kenma\appdata
    creating users\kenma\appdata\local
    creating users\kenma\appdata\local\temp
    C:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include/libxml2 /Tcc:\users\kenma\appdata\local\temp\xmlXPathInitdw65bp.c /Fousers\kenma\appdata\local\temp\xmlXPathInitdw65bp.obj
    xmlXPathInitdw65bp.c
    c:\users\kenma\appdata\local\temp\xmlXPathInitdw65bp.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: command 'C:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\users\kenma\appdata\local\temp\pip-build-c6lrhk\lxml\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\kenma\appdata\local\temp\pip-vhli1l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\kenma\appdata\local\temp\pip-build-c6lrhk\lxml\

这似乎与 lxml 安装有关,这是一个 scrapy 依赖项。
官方 documentation page 有一些解决方案,但建议对 windows 操作系统使用非官方二进制文件,可在此处找到:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml