python3.7 scrapy 错误 def write(self, data, async=False)解决方法

  File "", line 1006, in _gcd_import
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/site-packages/scrapy/extensions/telnet.py", line 12, in 
    from twisted.conch import manhole, telnet
  File "/usr/local/lib/python3.7/site-packages/twisted/conch/manhole.py", line 154
    def write(self, data, async=False):
                              ^
SyntaxError: invalid syntax

解释

这个错误是因为python3.7把async作为关键字了 scrapy中用到了此方法,所以出现的错误

修改方法很简单 把变量async 换个名称 随便写 就ok了
具体为在site-packages/twisted/conch/manhole.py

你可能感兴趣的:(python3.7 scrapy 错误 def write(self, data, async=False)解决方法)