scrapy runpider:错误:无法加载“ WebHarvestSpider.py”:无法从“ scrapy”导入名称“ squeue”

时间:2019-05-24 18:53:38

标签: scrapy

我正在尝试使用以下命令运行Scrapy Spider:

scrapy runspider -a main_url=https://www.imperium42.com WebHarvestSpider.py

我得到这个错误:

Usage
=====
  scrapy runspider [options] <spider_file>

runspider: error: Unable to load 'WebHarvestSpider.py': cannot import name 'squeue' from 'scrapy' (Usage
=====
  scrapy runspider [options] <spider_file>

runspider: error: Unable to load 'WebHarvestSpider.py': cannot import name 'squeue' from 'scrapy' (/Users/jv/anaconda3/lib/python3.7/site-packages/scrapy/__init__.py)
)

1 个答案:

答案 0 :(得分:1)

在Scrapy 1.0中,

scrapy.squeuerenamedscrapy.squeues

如果错误来自Scrapy本身,请尝试重新安装最新版本的Scrapy。

如果要在代码中导入scrapy.squeue,则需要更新代码。有关Scrapy API更改的完整历史记录,请参见Scrapy changelog