Python 3.7 pyspider all 报错

报错信息如下:

C:\Users\Administrator>pyspider all
Traceback (most recent call last):
  File "f:\installation position\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "f:\installation position\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "F:\Installation position\Anaconda3\Scripts\pyspider.exe\__main__.py", line 5, in <module>
  File "f:\installation position\anaconda3\lib\site-packages\pyspider\run.py", line 231
    async=True, get_object=False, no_input=False):
        ^
SyntaxError: invalid syntax

 

报错原因: 在python3.7中 async 是关键字,是不能作为函数的参数名的。

解决方案:根据上诉报错信息,定位到pyspider的位置。

比如我的pyspider的位置为:f:\installation position\anaconda3\lib\site-packages\pyspider

使用PyCharm打开,然后在菜单栏依次点击 edit -> find -> find in path

然后输入async 来查找修改,如下图所示:

注意:

1、以下截图为修改后的截图,为了演示效果,我这里查找时用的是修改后的变量名,请读者查找时输入async

2、部分读者会显示导入包的名称,如SimpleAsyncHTTPClient 就别改,只改小写的变量名就行

 

这时重新输入命令就可以运行了!

C:\Users\Administrator>pyspider all
f:\installation position\anaconda3\lib\site-packages\pyspider\libs\utils.py:196: FutureWarning: timeout is not supported on your platform.
  warnings.warn("timeout is not supported on your platform.", FutureWarning)
phantomjs fetcher running on port 25555
[I 200214 20:17:28 result_worker:49] result_worker starting...
[I 200214 20:17:30 processor:211] processor starting...
[I 200214 20:17:30 scheduler:647] scheduler starting...
[I 200214 20:17:30 scheduler:586] in 5m: new:0,success:0,retry:0,failed:0
[I 200214 20:17:31 tornado_fetcher:638] fetcher starting...
[I 200214 20:17:31 scheduler:782] scheduler.xmlrpc listening on 127.0.0.1:23333
[I 200214 20:17:31 app:76] webui running on 0.0.0.0:5000

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值