admin管理员组

文章数量:1534826

[twisted] CRITICAL: Unhandled error in Deferred 解决办法【亲测有效】
SO答案:https://stackoverflow/questions/45314514/scrapy-importerror-no-module-named-pipelines

先说原因:
ITEM_PIPELINES = {
‘tutorial.pipelines.jsonpipeline’: 800, // 错误
‘tutorial.pipelines.jsonpipeline.jsonpipeline’: 800, // 正确,原因是scrapy的目录结构有特殊约定
}
这里把pipiline管道放到pipelines包去了,导致scrapy需要重复一次类名。
----------------
默认pipelines.py包含所有的管道,如下:
ITEM_PIPELINES = {
‘tutorial.pipelines.jsonpipeline1’: 800,
‘tutorial.pipelines.jsonpipeline2’: 801,
}

Unhandled error in Deferred:
2022-04-30 23:19:28 [twisted] CRITICAL: Unhandled error in Deferred:

Traceback (most recent call last):
  File "C:\ProgramData\Miniconda3\envs\python383\lib\site-packages\scrapy\crawler.py", line 206, in crawl
    return self._crawl(crawler, *args, **kwargs)
  File "C:\ProgramData\Miniconda3\envs\python383\lib\site-pack

本文标签: 解决办法CriticaltwistedUnhandledDeferred