运行爬行时刮伤教程错误?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (73)

每次运行时都会收到此错误:

PALOMARESR-LALM:scrapy_tutorial brian$ scrapy crawl dmoz
2013-09-06 17:48:51-0700 [scrapy] INFO: Scrapy 0.18.2 started (bot: scrapy_tutorial)
2013-09-06 17:48:51-0700 [scrapy] DEBUG: Optional features available: ssl, http11
2013-09-06 17:48:51-0700 [scrapy] DEBUG: Overridden settings: {'NEWSPIDER_MODULE': 'scrapy_tutorial.spiders', 'SPIDER_MODULES': ['scrapy_tutorial.spiders'], 'BOT_NAME': 'scrapy_tutorial'}
2013-09-06 17:48:51-0700 [scrapy] DEBUG: Enabled extensions: LogStats, TelnetConsole, CloseSpider, WebService, CoreStats, SpiderState
Traceback (most recent call last):
  File "/usr/local/bin/scrapy", line 5, in <module>
    pkg_resources.run_script('Scrapy==0.18.2', 'scrapy')
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 492, in run_script

  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 1350, in run_script
    for name in eagers:
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/EGG-INFO/scripts/scrapy", line 4, in <module>
    execute()
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/cmdline.py", line 142, in execute
    _run_print_help(parser, _run_command, cmd, args, opts)
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/cmdline.py", line 88, in _run_print_help
    func(*a, **kw)
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/cmdline.py", line 149, in _run_command
    cmd.run(args, opts)
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/commands/crawl.py", line 50, in run
    self.crawler_process.start()
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/crawler.py", line 93, in start
    if self.start_crawling():
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/crawler.py", line 168, in start_crawling
    return self.start_crawler() is not None
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/crawler.py", line 151, in start_crawler
    crawler.configure()
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/crawler.py", line 45, in configure
    self.engine = ExecutionEngine(self, self._spider_closed)
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/core/engine.py", line 62, in __init__
    self.downloader = Downloader(crawler)
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/core/downloader/__init__.py", line 73, in __init__
    self.handlers = DownloadHandlers(crawler)
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/core/downloader/handlers/__init__.py", line 18, in __init__
    cls = load_object(clspath)
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/utils/misc.py", line 38, in load_object
    mod = __import__(module, {}, {}, [''])
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/core/downloader/handlers/s3.py", line 4, in <module>
    from .http import HTTPDownloadHandler
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/core/downloader/handlers/http.py", line 5, in <module>
    from .http11 import HTTP11DownloadHandler as HTTPDownloadHandler
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/core/downloader/handlers/http11.py", line 13, in <module>
    from scrapy.xlib.tx import Agent, ProxyAgent, ResponseDone, \
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/xlib/tx/__init__.py", line 6, in <module>
    from . import client, endpoints
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/xlib/tx/client.py", line 37, in <module>
    from .endpoints import TCP4ClientEndpoint, SSL4ClientEndpoint
  File "/Library/Python/2.7/site-packages/Scrapy-0.18.2-py2.7.egg/scrapy/xlib/tx/endpoints.py", line 222, in <module>
    interfaces.IProcessTransport, '_process')):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/zope/interface/declarations.py", line 495, in __call__
    raise TypeError("Can't use implementer with classes.  Use one of "
TypeError: Can't use implementer with classes.  Use one of the class-declaration functions instead.

我在OSX上运行,刮掉的版本信息如下:

PALOMARESR-LALM:~ brian$ scrapy version -v
Scrapy  : 0.18.2
lxml    : 3.2.3.0
libxml2 : 2.7.8
Twisted : 12.0.0
Python  : 2.7.2 (default, Oct 11 2012, 20:14:37) - [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
Platform: Darwin-12.4.0-x86_64-i386-64bit

有人能帮忙吗?

提问于
用户回答回答于

这是我的环境,我可以在没有问题的情况下运行scrapy爬行dmoz。https:/github.com/scrapy/dirbot)

$ Scrapy version -v
Scrapy  : 0.18.2
lxml    : 3.2.3.0
libxml2 : 2.7.8
Twisted : 13.1.0
Python  : 2.7.2 (default, Oct 11 2012, 20:14:37) - [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
Platform: Darwin-12.4.0-x86_64-i386-64bit

也许你可以像这样使用pip更新

pip install --upgrade Scrapy
用户回答回答于

运行这个更新Zope:

sudo pip install --upgrade zope.interface

所属标签

可能回答问题的人

  • 西风

    renzha.net · 站长 (已认证)

    9 粉丝1 提问5 回答
  • uncle_light

    5 粉丝518 提问3 回答
  • 学生

    2 粉丝477 提问3 回答
  • 军哥

    重庆雷驰信息技术有限公司 · 经理 (已认证)

    5 粉丝1 提问3 回答

扫码关注云+社区

领取腾讯云代金券