- 关键字问题
最后一句出现
File “D:\installed\Python\Lib\site-packages\pyspider\run.py”, line 231
async=True, get_object=False, no_input=False):
SyntaxError: invalid syntax
原因是:python3.7中async是关键字
解决办法是将这个关键字替换掉。主要有两个文件:D:\installed\Python\Lib\site-packages\pyspider\run.py 和 D:\installed\Python\Lib\site-packages\pyspider\fetcher\tornado_fetcher.py
在替换是要注意:只替换名为async 的变量或参数名。不要图省事选择“全部替换”
替换保存后再次运行“pyspider all”
这时spider只启动到“scheduler xmlrpc listening on 127.0.0.1:23333”就停止了
继续替换PYTHON_HOME\Lib\site-packages\pyspider\webui\app.py中的async
再次启动
又报错:ValueError: Invalid configuration:
-Deprecated option ‘domaincontroller’: use ‘http_authenticator.domain_controller’ instead.
解决办法:打开PYTHON_HOME\Lib\site-packages\pyspider\webui\webdav.py文件,修改第209行
把 ‘domaincontroller’: NeedAuthController(app)
修改为:
‘http_authenticator’:{
‘HTTPAuthenticator’:NeedAuthController(app),
},
保存文件
再次运行,成功
python3.7启动pyspider时报错的问题
最新推荐文章于 2024-08-09 23:33:06 发布