我只是想启动并运行 Dash 教程,但每次我尝试运行它,从文档复制并粘贴到我的 asdf.py 中时,我都会收到错误“ImportError:无法从 'dash' 导入名称 'dcc'” ”。我尝试卸载并重新安装 dash,并重命名文件,但无济于事。任何帮助表示赞赏,谢谢!
from dash import Dash, dcc, html, Input, Output
app = Dash(__name__)
app.layout = html.Div([
html.H6("Change the value in the text box to see callbacks in action!"),
html.Div([
"Input: ",
dcc.Input(id='my-input', value='initial value', type='text')
]),
html.Br(),
html.Div(id='my-output'),
])
Run Code Online (Sandbox Code Playgroud)