Callback Question NameError: name 'Output' is not defined'

I am attempting to build a callback that will update a dropdown. The code snippet below returns an error: NameError: name ‘Output’ is not defined
I cannot see where this error occurs. Is this a symptom of an error when creating the layout items?

app.layout = dbc.Container([
dbc.Row([
dbc.Col([sidebar], width=3),
dbc.Col([content1], width=9),
dbc.Col([content2], width=9),
dbc.Col([content3], width=9),
dbc.Col([content4], width=9)
])
]) # Container

Dropdown Callback

@app.callback(
Output(component_id=‘geo_dropdown’, component_property=‘options’), ← Error here
Input(component_id=‘profile_dropdown’, component_property=‘value’)
)
def update_dropdown(value):
if(value == “Region”) :
findict = [{‘label’ : k, ‘value’ : v} for k, v in region_data.items()]
elif(value == “County”) :
outdict = geo_data[[“CTYNAME”, “CTY_GEOID”]].unique()
findict = [{‘label’ : k, ‘value’ : v} for k, v in outdict.items()]
else :
outdict = geo_data[[“PLNAME”, “PL_GEOID”]].unique()
findict = [{‘label’ : k, ‘value’ : v} for k, v in outdict.items()]

return findict

I would appreciate any suggestions about how to diagnose this error.
TIA

Hi @abick

Do you have at the top of the page

from dash import Output, Input

Thank you, @AnnMarieW. That was the issue.
Cheers–
AB

1 Like