hippocampus
hippocampus

Reputation: 347

404 error when i call app from Dash in Jupyter notebook on Windows

I am trying to use Dash within a jupyter notebook on Windows. i have installed the jupyter_plotly_dash from anaconda terminal and I tried to run the example below:

from jupyter_plotly_dash import JupyterDash

import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output

app = JupyterDash('SimpleExample')

app.layout = html.Div([
    dcc.RadioItems(
        id='dropdown-color',
        options=[{'label': c, 'value': c.lower()}
                 for c in ['Red', 'Green', 'Blue']],
        value='red'
    ),
    html.Div(id='output-color'),
    dcc.RadioItems(
        id='dropdown-size',
        options=[{'label': i, 'value': j}
                 for i, j in [('L','large'), ('M','medium'), ('S','small')]],
        value='medium'
    ),
    html.Div(id='output-size')

])

@app.callback(
    dash.dependencies.Output('output-color', 'children'),
    [dash.dependencies.Input('dropdown-color', 'value')])
def callback_color(dropdown_value):
    return "The selected color is %s." % dropdown_value

@app.callback(
    dash.dependencies.Output('output-size', 'children'),
    [dash.dependencies.Input('dropdown-color', 'value'),
     dash.dependencies.Input('dropdown-size', 'value')])
def callback_size(dropdown_color, dropdown_size):
    return "The chosen T-shirt is a %s %s one." %(dropdown_size,
                                                  dropdown_color)

app

and i get this following message when i try to call the app. Any idea as to why it's happening. Any hint would be highly appreciated. Thank you.

enter image description here

Upvotes: 1

Views: 600

Answers (1)

0x26res
0x26res

Reputation: 13952

You're not the first one to have this issue. It's discussed here.

What worked for me was doing this:

pip install jupyter_server_proxy 
jupyter serverextension enable jupyter_server_proxy

Upvotes: 1

Related Questions