gpt4 book ai didi

python - 在 win 7(64 位)上安装 scrapy

转载 作者:太空狗 更新时间:2023-10-29 21:53:20 27 4
gpt4 key购买 nike

我正在尝试为 python2.6 安装 scrapy,但似乎不太顺利。这是安装的包:

G:\Python26\Scripts>pip freeze
Scrapy==0.16.4
Twisted==12.3.0
libxml2-python==2.7.7
lxml==2.3.6
pyopenssl==0.13
w3lib==1.2
zope.interface==3.8.0

我还有 iconv 和 zlib。这是用pip安装scrapy时的日志。我不知道下一步该做什么,我错过了什么吗?需要说明,谢谢。

win 7 64 位,已安装 Visual C++

C:\Users\d>pip install scrapy
Downloading/unpacking scrapy
Downloading Scrapy-0.16.4.tar.gz (679kB): 679kB downloaded
Running setup.py egg_info for package scrapy
warning: no files found matching 'license.txt' under directory 'scrapy'
no previously-included directories found matching 'docs\build'
Requirement already satisfied (use --upgrade to upgrade): Twisted>=8.0 in g:\pyt
hon26\lib\site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): w3lib>=1.2 in g:\pytho
n26\lib\site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): lxml in g:\python26\li
b\site-packages\lxml-2.3.6-py2.6-win32.egg (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): pyOpenSSL in g:\python
26\lib\site-packages\pyopenssl-0.13-py2.6-win32.egg (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): zope.interface>=3.6.0
in g:\python26\lib\site-packages\zope.interface-3.8.0-py2.6-win32.egg (from Twis
ted>=8.0->scrapy)
Requirement already satisfied (use --upgrade to upgrade): setuptools in g:\pytho
n26\lib\site-packages (from zope.interface>=3.6.0->Twisted>=8.0->scrapy)
Installing collected packages: scrapy
Running setup.py install for scrapy
warning: no files found matching 'license.txt' under directory 'scrapy'
no previously-included directories found matching 'docs\build'
Successfully installed scrapy
Cleaning up...


C:\Users\d>scrapy
Traceback (most recent call last):
File "G:\Python26\lib\runpy.py", line 122, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "G:\Python26\lib\runpy.py", line 34, in _run_code
exec code in run_globals
File "G:\Python26\lib\site-packages\scrapy\cmdline.py", line 7, in <module>
from scrapy.crawler import CrawlerProcess
File "G:\Python26\lib\site-packages\scrapy\crawler.py", line 5, in <module>
from scrapy.core.engine import ExecutionEngine
File "G:\Python26\lib\site-packages\scrapy\core\engine.py", line 14, in <modul
e>
from scrapy.core.downloader import Downloader
File "G:\Python26\lib\site-packages\scrapy\core\downloader\__init__.py", line
16, in <module>
from .middleware import DownloaderMiddlewareManager
File "G:\Python26\lib\site-packages\scrapy\core\downloader\middleware.py", lin
e 7, in <module>
from scrapy.http import Request, Response
File "G:\Python26\lib\site-packages\scrapy\http\__init__.py", line 11, in <mod
ule>
from scrapy.http.request.form import FormRequest
File "G:\Python26\lib\site-packages\scrapy\http\request\form.py", line 9, in <
module>
import lxml.html
File "G:\Python26\lib\site-packages\lxml-2.3.6-py2.6-win32.egg\lxml\html\__ini
t__.py", line 12, in <module>
from lxml import etree
ImportError: DLL load failed: %1 is not a valid Win32 application

最佳答案

您需要按照说明进行操作 here (也在上面列出)。

问题中列出的特定 DLL 错误是由于(至少在我的情况下)安装 32 位 OpenSSL 和 64 位其他一切。在我安装了正确的 OpenSSL 之后(并且,顺便说一句,不得不卸载上面链接中的所有软件包并开始为依赖项 msi 安装程序进行过度排序),scrapy 在 python27、windows7、64 位上运行良好。

关于python - 在 win 7(64 位)上安装 scrapy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14765723/

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