禁用scrapy的memusage扩展

时间:2016-01-22 14:21:53

标签: python scrapy twisted

尝试运行自定义刮刀时,出现以下错误:

  File "/home/barfoo/env/lib/python3.4/site-packages/scrapy/extensions/memusage.py", line 16, in <module>
    from scrapy.mail import MailSender
  File "/home/barfoo/env/lib/python3.4/site-packages/scrapy/mail.py", line 23, in <module>
    from twisted.mail.smtp import ESMTPSenderFactory
ImportError: No module named 'twisted.mail'

虽然Twistedscrapy都是requirements.txt的一部分:

Twisted==15.5.0
scrapy==1.0.0

(与env/bin/pip install -r requirements.txt一起安装)

在线寻找帮助并没有带来快速解决方案。但是memusage不是必需的。有没有办法在蜘蛛本身或main

中禁用扩展名

1 个答案:

答案 0 :(得分:0)

您可以通过在memusage scrapy文件中禁用settings.py来停用它。像这样: MEMUSAGE_ENABLED = False