简体   繁体   中英

Plotly Dash ImportError: cannot import name 'dcc' from 'dash'

I'm just trying to get the Dash tutorial up and running but every time I try to run it, copy and pasted from the documentation into my asdf.py I get the error "ImportError: cannot import name 'dcc' from 'dash'". I've tried uninstalling and reinstalling dash, along with renaming the file and got nowhere. Any help is appreciated, thanks!

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'),

])

Either try: pip install dash --upgrade

or instead (for older versions): import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM