Can’t even get to the starting line. Seriously. What am I doing wrong?
app.layout assignment fails. it runs if I omit the square brackets, or change them to parentheses. maddening.
Welcome! I don’t even thought about it, but if it works without parentheses, go that way!
Nope. Because the same wild guesses don’t work on the next tutorial example. And wild guesses aren’t really the way to go, in any case.
What version of Dash are you using? It is a relatively recent addition to allow passing a list to the layout, it used to be that you can only pass a component.
Dash 2.14.2 (it’s in the screenshot). Python 3.12.3.
So it looks like the current release of dash is 2.18.2.
But it seems Anaconda wants 2.14.2, at least that’s the case in my environment.
Is that the difference? sigh
Gonna be a lot more than 20 minutes
instead of
app.layout = [html.Div(children="Hello World")]
this:
app.layout = html.Div(children="Hello World")
There’s no reason anaconda would be stuck on dash 2.14, not sure what’s your setup though.
Maybe the example should check to see the version of dash that is running?
Yes, we should definitely do something about this. Let me talk this over with our technical writers and get back to you.
Thank you all for bringing this up.
indeed, @JuanG . The list wrapper of the app’s layout has been available since Dash 2.17.0 (fourth issue #2795).
Based on @jinnyzor 's suggestions, what if we add a comment to the initial code in the Dash-in-20 chapter that tells the user to check for the correct Dash version. Something like:
app.layout = [html.Div(children='Hello World')] # make sure you have installed Dash 2.17.0 or a later version for this to work.