pyspider 启动错误

[root@localhost python]# pyspider all
[W 180629 07:08:26 run:413] phantomjs not found, continue running without it.
[I 180629 07:08:29 result_worker:49] result_worker starting...
[I 180629 07:08:31 processor:211] processor starting...
[I 180629 07:08:31 tornado_fetcher:638] fetcher starting...
[I 180629 07:08:31 scheduler:675] scheduler starting...
[I 180629 07:08:31 scheduler:614] in 5m: new:0,success:0,retry:0,failed:0
[I 180629 07:08:31 scheduler:810] scheduler.xmlrpc listening on 127.0.0.1:23333
[I 180629 07:08:32 app:84] webui exiting...
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.6.5/bin/pyspider", line 11, in <module>
    load_entry_point('pyspider==0.3.10', 'console_scripts', 'pyspider')()
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pyspider-0.3.10-py3.6.egg/pyspider/run.py", line 754, in main
    cli()
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pyspider-0.3.10-py3.6.egg/pyspider/run.py", line 497, in all
    ctx.invoke(webui, **webui_config)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pyspider-0.3.10-py3.6.egg/pyspider/run.py", line 384, in webui
    app.run(host=host, port=port)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pyspider-0.3.10-py3.6.egg/pyspider/webui/app.py", line 59, in run
    from .webdav import dav_app
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pyspider-0.3.10-py3.6.egg/pyspider/webui/webdav.py", line 216, in <module>
    dav_app = WsgiDAVApp(config)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/WsgiDAV-3.0.0a2-py3.6.egg/wsgidav/wsgidav_app.py", line 122, in __init__
    _check_config(config)
  File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/WsgiDAV-3.0.0a2-py3.6.egg/wsgidav/wsgidav_app.py", line 104, in _check_config
    raise ValueError("Invalid configuration:\n  - " + "\n  - ".join(errors))
ValueError: Invalid configuration:
  - Deprecated option 'dir_browser.enable': use 'middleware_stack' instead.
  - Deprecated option 'domaincontroller': use 'domain_controller' instead.
阅读 13.1k
5 个回答
二楼正解,但是只解决了一部分问题,后面还有一个Deprecated option 'domaincontroller': use 'domain_controller' instead的问题。
wsgidav发布的3.x版本目前仍然是测试版,相对于2.x(例如2.4.1)更改了一些用法,上面报错的两个部分就是的。pyspider的3.0及以上版本在安装时,会默认安装wsgidav的3.x版(具体的版本可能会有偏差)。其实上面错误信息已经提示该如何改了,不过那样改比较麻烦。可以换个方法,换回wsgidav的2.x版本就不会报错了。先把3.x版卸载,再装2.x版(pip安装wsgidav会默认安装2.x版  我的是2.4.1版)。下面是具体的卸载安装的命令
windows下进入cmd,(linux下打开终端),输入: 
                     pip uninstall wsgidav  
                     pip install wsgidav
如果报错失败,按照下面的再试一次,(一般linux不会出错,windows下可能输入下面的命令)
                     python -m pip uninstall wsgidav
                     python -m pip install wsgidav
如果安装的wsgidav版本还是3.x版本,可以在卸载这个版本之后, 在安装命令后面加上具体版本
例如  python -m pip install wsgidav==2.4.1
                   
新手上路,请多包涵

我也遇到此问题,发现github里面也有人在问,我已做回答,把解决办法在这里同步一下。

这是WsgiDAV发布了版本 pre-release 3.x导致的。

修改 pyspider/webui/webdav.py 第203行:

 config = DEFAULT_CONFIG.copy()
 config.update({
    'mount_path': '/dav',
    'provider_mapping': {
        '/': ScriptProvider(app)
    },
    #'domaincontroller': NeedAuthController(app),
    'http_authenticator': {
        'HTTPAuthenticator':NeedAuthController(app),
    },
    
    'verbose': 1 if app.debug else 0,
    
    'dir_browser': {'davmount': False,
                    #'enable': True,
                    'msmount': False,
                    'response_trailer': ''},
})
dav_app = WsgiDAVApp(config)

然后执行:

#python setup.py install



新手上路,请多包涵

Did you solve the problem?I have the same problem

除了手动修改代码,我此处用,安装旧版本,也可以解决问题:

pipenv install wsgidav==2.4.1
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏