0

I'm experiencing some problems while running the new Dash version (2.11). I'm used to use some print statements inside the callbacks as debug feature (to print values, values types ecc.) and everything was working properly, the print statement was printed in jupyter_lab after the block every time the callback was clicked.

This is a minimum working example of the code, now the print statement is not working. Is there anyone that can help me with this?

from dash import Dash, html
from dash import Dash, dcc, html, Input, Output, State, dash_table, callback_context
import dash_bootstrap_components as dbc

import jupyterlab_dash
from jupyter_dash import JupyterDash

app = Dash(external_stylesheets=[dbc.themes.SLATE])#[dbc.themes.SLATE])
#run the server locally without the aid of the internet connection
# Serve files locally
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True


app = JupyterDash(external_stylesheets=[dbc.themes.SLATE] )#[dbc.themes.SLATE])         SLATE #2

#run the server locally without the aid of the internet connection
# Serve files locally
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True


app.layout = dbc.Container(
                            [html.Button('click-me', id='button', n_clicks=0),
                             html.H1('click-me', id = "text")
                            ]
                          )


@app.callback(
    
    [    
    Output("text", "children")
    ]
    ,
    [
    Input("button", "n_clicks"),
    ]
)
def button(n_clicks):
    print("button is pressed")
     
    return ["button was pressed {} times ".format(n_clicks)]


if __name__ == '__main__':
    app.run_server(debug=True,port = 8057, jupyter_mode="external")


DragonSpirit
  • 11
  • 1
  • 3

0 Answers0