gpt4 book ai didi

python - Windows7下安装Scrapy

转载 作者:行者123 更新时间:2023-11-28 22:59:13 26 4
gpt4 key购买 nike

我尝试使用简易安装来安装 Scrapy。我安装了 Cython,它似乎可以工作,我安装了 libxml2 形式 http://www.lfd.uci.edu/~gohlke/pythonlibs/我在这篇文章后更改了 cygwinccompiler scrapy installation error我仍然遇到错误,不知道下一步该怎么做。我也不知道为什么它是 Building without Cython 我有 Windows 7 32 位和 Python 2.7

C:\Users\t>easy_install -U Scrapy
Searching for Scrapy
Reading http://pypi.python.org/simple/Scrapy/
Reading http://scrapy.org
Best match: scrapy 0.16.1
Processing scrapy-0.16.1-py2.7.egg
scrapy 0.16.1 is already the active version in easy-install.pth
Installing scrapy script to C:\Python27\Scripts
Installing scrapy.bat script to C:\Python27\Scripts

Using c:\python27\lib\site-packages\scrapy-0.16.1-py2.7.egg
Processing dependencies for Scrapy
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 3.0.1
Downloading http://lxml.de/files/lxml-3.0.1.tgz
Processing lxml-3.0.1.tgz
Running lxml-3.0.1\setup.py -q bdist_egg --dist-dir c:\users\t\appdata\lo
cal\temp\easy_install-7mgdch\lxml-3.0.1\egg-dist-tmp-686xm8
Building lxml version 3.0.1.
Building without Cython.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
warning: no files found matching '*.txt' under directory 'src\lxml\tests'
In file included from src\lxml\lxml.etree.c:254:0:
c:\users\t\appdata\local\temp\easy_install-7mgdch\lxml-3.0.1\src\lxml\inc
ludes/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or direc
tory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

最佳答案

不确定你是否已经解决了。我今天遇到了这个问题,这是我解决它的方法,直接获取 lxml 二进制文件:http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml

并且 pip install Scrapy 以某种方式忽略了你已经安装它并尝试再次构建的事实,所以它会失败。然而,在你运行 pip install 的目录中会有一个'build'目录,在那里找到'Scrapy\setup.py'。

现在在文件底部找到:

setup_args['install_requires'] = ...

并删除 lxml 和 pyopenssl(如果您在 Windows 上工作,您很可能需要直接安装二进制文件,顺便说一句,可以在这里找到:http://slproweb.com/products/Win32OpenSSL.html)

从同一目录再次运行 pip install Scrapy,你应该可以开始了。

关于python - Windows7下安装Scrapy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13215220/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com