

dashがうまく動きません。  
dashの例題のコードのコピペですら動きません。

[code]

    # -*- coding: utf-8 -*-
    
    # Run this app with `python app.py` and
    # visit http://127.0.0.1:8050/ in your web browser.
    
    import dash
    import dash_core_components as dcc
    import dash_html_components as html
    import plotly.express as px
    import pandas as pd
    
    external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
    
    app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
    
    # assume you have a "long-form" data frame
    # see https://plotly.com/python/px-arguments/ for more options
    df = pd.DataFrame({
        "Fruit": ["Apples", "Oranges", "Bananas", "Apples", "Oranges", "Bananas"],
        "Amount": [4, 1, 2, 2, 4, 5],
        "City": ["SF", "SF", "SF", "Montreal", "Montreal", "Montreal"]
    })
    
    fig = px.bar(df, x="Fruit", y="Amount", color="City", barmode="group")
    
    app.layout = html.Div(children=[
        html.H1(children='Hello Dash'),
    
        html.Div(children='''
            Dash: A web application framework for Python.
        '''),
    
        dcc.Graph(
            id='example-graph',
            figure=fig
        )
    ])
    
    if __name__ == '__main__':
        app.run_server(debug=True)
    
[/code]

実行時の表示

[code]

    Dash is running on http://127.0.0.1:8050/
    
     * Serving Flask app "__main__" (lazy loading)
     * Environment: production
       WARNING: This is a development server. Do not use it in a production deployment.
       Use a production WSGI server instead.
     * Debug mode: on
    An exception has occurred, use %tb to see the full traceback.
    
    SystemExit: 1
    
    
    c:\users\owner\appdata\local\programs\python\python38-32\lib\site-packages\IPython\core\interactiveshell.py:3425: UserWarning:
    
    To exit: use 'exit', 'quit', or Ctrl-D.
    
[/code]

[![画像の説明をここに入力](https://i.stack.imgur.com/x3oON.png)](https://i.stack.imgur.com/x3oON.png)  
どうすれば、動くようにできるのでしょうか？


CC BY-SA 4.0
2021-06-03T14:10:22.770
76310
2021-06-03T14:10:22.770
42741
question
python
dashがうまく動きません。