安装pyspider后运行pyspider all后遇到的问题

举报
指剑 发表于 2022/09/03 00:51:13 2022/09/03
【摘要】 问题1------提示无法找到包 “DispatcherMiddleware” Traceback (most recent call last): File "D:\Programs\Python...

问题1------提示无法找到包 “DispatcherMiddleware”

Traceback (most recent call last):
  File "D:\Programs\Python36\Scripts\pyspider-script.py", line 11, in <module>
    load_entry_point('pyspider==0.3.10', 'console_scripts', 'pyspider')()
  File "d:\programs\python36\lib\site-packages\pyspider\run.py", line 754, in main
    cli()
  File "d:\programs\python36\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "d:\programs\python36\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "d:\programs\python36\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "d:\programs\python36\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "d:\programs\python36\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "d:\programs\python36\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "d:\programs\python36\lib\site-packages\pyspider\run.py", line 497, in all
    ctx.invoke(webui, **webui_config)
  File "d:\programs\python36\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "d:\programs\python36\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "d:\programs\python36\lib\site-packages\pyspider\run.py", line 384, in webui
    app.run(host=host, port=port)
  File "d:\programs\python36\lib\site-packages\pyspider\webui\app.py", line 64, in run
    from werkzeug.wsgi import DispatcherMiddleware
ImportError: cannot import name 'DispatcherMiddleware'

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

解决方法

将C:\Python\Lib\site-packages\pyspider\webui.app.py中64行的代码进行修改

from werkzeug.wsgi import DispatcherMiddleware
修改为
from werkzeug.middleware.dispatcher import DispatcherMiddleware

  
 
  • 1
  • 2
  • 3
  • 4

在这里插入图片描述

问题2-----提示"Deprecated option ‘domaincontroller’: use ‘http_authenticator.domain_controller’ instead."

Traceback (most recent call last):
  File "D:\Programs\Python36\Scripts\pyspider-script.py", line 11, in <module>
    load_entry_point('pyspider==0.3.10', 'console_scripts', 'pyspider')()
  File "d:\programs\python36\lib\site-packages\pyspider\run.py", line 754, in main
    cli()
  File "d:\programs\python36\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "d:\programs\python36\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "d:\programs\python36\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "d:\programs\python36\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "d:\programs\python36\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "d:\programs\python36\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "d:\programs\python36\lib\site-packages\pyspider\run.py", line 497, in all
    ctx.invoke(webui, **webui_config)
  File "d:\programs\python36\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "d:\programs\python36\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "d:\programs\python36\lib\site-packages\pyspider\run.py", line 384, in webui
    app.run(host=host, port=port)
  File "d:\programs\python36\lib\site-packages\pyspider\webui\app.py", line 59, in run
    from .webdav import dav_app
  File "d:\programs\python36\lib\site-packages\pyspider\webui\webdav.py", line 216, in <module>
    dav_app = WsgiDAVApp(config)
  File "d:\programs\python36\lib\site-packages\wsgidav\wsgidav_app.py", line 133, in __init__
    _check_config(config)
  File "d:\programs\python36\lib\site-packages\wsgidav\wsgidav_app.py", line 117, in _check_config
    raise ValueError("Invalid configuration:\n  - " + "\n  - ".join(errors))
ValueError: Invalid configuration:
  - Deprecated option 'domaincontroller': use 'http_authenticator.domain_controller' instead.

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35

解决方法

修改对应的配置文件

C:\Programs\Python36\Lib\site-packages\pyspider\webui\webdav.py
将第209行进行修改,如下

  
 
  • 1
  • 2

在这里插入图片描述

文章来源: blog.csdn.net,作者:指剑,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/fly1574/article/details/121256774

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。