美文网首页
python3.7 scrapy 错误 def write(se

python3.7 scrapy 错误 def write(se

作者: 魔童转世 | 来源:发表于2018-08-13 10:21 被阅读0次
      File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
      File "<frozen importlib._bootstrap>", line 983, in _find_and_load
      File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/usr/local/lib/python3.7/site-packages/scrapy/extensions/telnet.py", line 12, in <module>
        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(se

          本文链接:https://www.haomeiwen.com/subject/lweybftx.html