执行 pyspider all
启动命令报错如下:
C:\Users\Lenovo>pyspider all
e:\python\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)
[W 190915 16:08:38 run:413] phantomjs not found, continue running without it.
[I 190915 16:08:40 result_worker:49] result_worker starting...
[I 190915 16:08:44 processor:211] processor starting...
[I 190915 16:08:44 scheduler:647] scheduler starting...
[I 190915 16:08:44 scheduler:586] in 5m: new:0,success:0,retry:0,failed:0
[I 190915 16:08:45 tornado_fetcher:638] fetcher starting...
[I 190915 16:08:45 scheduler:782] scheduler.xmlrpc listening on 127.0.0.1:23333
[I 190915 16:08:47 tornado_fetcher:671] fetcher exiting...
[I 190915 16:08:47 app:84] webui exiting...
[I 190915 16:08:47 scheduler:663] scheduler exiting...
[I 190915 16:08:47 result_worker:66] result_worker exiting...
[I 190915 16:08:48 processor:229] processor exiting...
Traceback (most recent call last):File "E:\Python\Scripts\pyspider-script.py", line 11, in <module>load_entry_point('pyspider==0.3.10', 'console_scripts', 'pyspider')()File "e:\python\lib\site-packages\pyspider\run.py", line 754, in maincli()File "e:\python\lib\site-packages\click\core.py", line 722, in __call__return self.main(*args, **kwargs)File "e:\python\lib\site-packages\click\core.py", line 697, in mainrv = self.invoke(ctx)File "e:\python\lib\site-packages\click\core.py", line 1066, in invokereturn _process_result(sub_ctx.command.invoke(sub_ctx))File "e:\python\lib\site-packages\click\core.py", line 895, in invokereturn ctx.invoke(self.callback, **ctx.params)File "e:\python\lib\site-packages\click\core.py", line 535, in invokereturn callback(*args, **kwargs)File "e:\python\lib\site-packages\click\decorators.py", line 17, in new_funcreturn f(get_current_context(), *args, **kwargs)File "e:\python\lib\site-packages\pyspider\run.py", line 497, in allctx.invoke(webui, **webui_config)File "e:\python\lib\site-packages\click\core.py", line 535, in invokereturn callback(*args, **kwargs)File "e:\python\lib\site-packages\click\decorators.py", line 17, in new_funcreturn f(get_current_context(), *args, **kwargs)File "e:\python\lib\site-packages\pyspider\run.py", line 384, in webuiapp.run(host=host, port=port)File "e:\python\lib\site-packages\pyspider\webui\app.py", line 59, in runfrom .webdav import dav_appFile "e:\python\lib\site-packages\pyspider\webui\webdav.py", line 216, in <module>dav_app = WsgiDAVApp(config)File "e:\python\lib\site-packages\wsgidav\wsgidav_app.py", line 135, in __init___check_config(config)File "e:\python\lib\site-packages\wsgidav\wsgidav_app.py", line 119, in _check_configraise ValueError("Invalid configuration:\n - " + "\n - ".join(errors))
ValueError: Invalid configuration:- Deprecated option 'domaincontroller': use 'http_authenticator.domain_controller' instead.
原因分析:WsgiDAV 使用了新版本 pre-release 3.0.0(WsgiDAV 是一个用 Python 开发的通用 WebDAV 服务器,基于 WSGI 运行,支持 SSL)
解决方法一:将 WsgiDAV 版本降级到 2.4.1版本,使用命令 pip install wsgidav==2.4.1
安装即可
解决方法二:在 Python 安装路径下,找到 webdav.py
文件,比如我的路径为:E:\Python\Lib\site-packages\pyspider\webui\webdav.py
定位到第 209 行,找到如下代码:
'domaincontroller': NeedAuthController(app),
修改为如下代码并保存:
'http_authenticator':{'HTTPAuthenticator':NeedAuthController(app),},