为了账号安全,请及时绑定邮箱和手机立即绑定

为什么运行此 Dash 应用程序会产生 TypeError

为什么运行此 Dash 应用程序会产生 TypeError

莫回无 2023-05-09 09:51:46
我收到以下错误:"Traceback (most recent call last):  File "app.py", line 11, in <module>    app = dash.Dash()  File "C:\Users\oefel\AppData\Local\Programs\Python\Python38-32\lib\site-packages\dash\dash.py", line 268, in __init__self.server = flask.Flask(name) if server else None  File "C:\Users\oefel\AppData\Local\Programs\Python\Python38-32\lib\site-packages\flask\app.py", line 559, in __init__self.add_url_rule(  File "C:\Users\oefel\AppData\Local\Programs\Python\Python38-32\lib\site-packages\flask\app.py", line 67, in wrapper_func    return f(self, *args, **kwargs)  File "C:\Users\oefel\AppData\Local\Programs\Python\Python38-32\lib\site-packages\flask\app.py", line 1217, in add_url_rule    self.url_map.add(rule)  File "C:\Users\oefel\AppData\Local\Programs\Python\Python38-32\lib\site-packages\werkzeug\routing.py", line 1388, in add    rule.bind(self)  File "C:\Users\oefel\AppData\Local\Programs\Python\Python38-32\lib\site-packages\werkzeug\routing.py", line 730, in bind    self.compile()  File "C:\Users\oefel\AppData\Local\Programs\Python\Python38-32\lib\site-packages\werkzeug\routing.py", line 794, in compile    self._build = self._compile_builder(False).__get__(self, None)  File "C:\Users\oefel\AppData\Local\Programs\Python\Python38-32\lib\site-packages\werkzeug\routing.py", line 951, in _compile_builder    code = compile(module, "<werkzeug routing>", "exec")TypeError: required field "type_ignores" missing from Module"在运行 Dash 应用程序时。这是我的代码:import dashfrom dash.dependencies import Input, Outputimport dash_rendererimport dash_html_components as html  # div_tagsimport dash_core_components as dcc  # graphsimport plotlyapp = dash.Dash()colors = {    'background': '#111111',    'text': '#7FDBFF'}app.layout = html.Div(style={'backgroundColor': colors['background']}, children=[    html.H1(        children='Hello Dash',        style={            'textAlign': 'center',            'color': colors['text']        }    ),我进行了一些搜索,但没有发现任何可以表明此错误含义的信息。谁能提供任何见解?谢谢你!
查看完整描述

1 回答

?
互换的青春

TA贡献1797条经验 获得超6个赞

您需要更新您的 Werkzeug 版本以兼容 Python 3.8。



查看完整回答
反对 回复 2023-05-09
  • 1 回答
  • 0 关注
  • 73 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信