I am testing Dash with VS code
in Windows 10
.
I go to the official website to collect the minimal Dash app. https://dash.plotly.com/minimal-app
The contents (of my file: minimal_dash_app.py) are:
from dash import Dash, html, dcc, callback, Output, Input
import plotly.express as px
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminder_unfiltered.csv')
app = Dash(__name__)
app.layout = html.Div([
html.H1(children='Title of Dash App', style={'textAlign':'center'}),
dcc.Dropdown(df.country.unique(), 'Canada', id='dropdown-selection'),
dcc.Graph(id='graph-content')
])
@callback(
Output('graph-content', 'figure'),
Input('dropdown-selection', 'value')
)
def update_graph(value):
dff = df[df.country==value]
return px.line(dff, x='year', y='pop')
if __name__ == '__main__':
app.run(debug=True)
When i try to run this, it fails, returning this:
Dash is running on http://127.0.0.1:8050/
* Serving Flask app 'minimal_dash_app'
* Debug mode: on
0.02s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
No module named minimal_dash_app
However, when i delete the debug=True
part from the last line, it works.
So app.run()
works.
And also app.run(debug=False)
works.
why is this ? And what does debug=True
do ?