Hi, I’m trying to use the Pycharm debug console in order to run Dash apps. I’ve had success in the past while running Dash apps in the console, getting a result such as:
Dash is running on http://127.0.0.1:8050/
- Serving Flask app ‘app’
- Debug mode: on
This is what would be printed out when I select to “Run File in Python Console” through Pycharm.
I am currently setting up a brand-new system (without my old system to compare to), and running into an issue. When I run the following code;
# Run this app with `python app.py` and
# visit http://127.0.0.1:8050/ in your web browser.
from dash import Dash, html, dcc
import plotly.express as px
import pandas as pd
app = Dash(__name__)
# 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 your data.
'''),
dcc.Graph(
id='example-graph',
figure=fig
)
])
if __name__ == '__main__':
app.run(debug=True)
(this is just some basic boilerplate code from the plotly website).
Running this code in the console I get the following result:
<IPython.lib.display.IFrame at 0x1c75fbffe50>
The code terminates after printing out this one line. Running through the terminal or running in a Anaconda shell, I get the expected behavior of the code starting out as expected, but for some reason running in the console is giving me an issue. I haven’t gotten this issue running in the console in the past, so I believe there should be a way to fix it.
I am using the most up to date Dash version.