# Dash TypeError when running dropdown example code

**URL:** <https://community.plotly.com/t/dash-typeerror-when-running-dropdown-example-code/62068>\
**Category:** Dash Python\
**Created:** [March 18, 2022, 3:39pm UTC](https://community.plotly.com/t/dash-typeerror-when-running-dropdown-example-code/62068 "2022-03-18T15:39:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rp1](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@rp1](https://community.plotly.com/u/rp1)\
**Post date:** [March 18, 2022, 3:39pm UTC](https://community.plotly.com/t/dash-typeerror-when-running-dropdown-example-code/62068/1 "2022-03-18T15:39:15Z")

</div>

Hello,

Learning Dash. When I copy and run dropdown example code from Plotly website it produces error:  
line 9, in   
dcc.Dropdown([‘NYC’, ‘MTL’, ‘SF’], ‘NYC’, id=‘demo-dropdown’),  
File “/Users/r/opt/anaconda3/lib/python3.9/site-packages/dash/development/base\_component.py”, line 366, in wrapper  
return func(\*args, \*\*kwargs)  
TypeError: **init** () got multiple values for argument ‘id’

Code:

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

app = Dash( __name__ )
app.layout = html.Div([
    dcc.Dropdown(['NYC', 'MTL', 'SF'], 'NYC', id='demo-dropdown'),
    html.Div(id='dd-output-container')
])

@app.callback(
    Output('dd-output-container', 'children'),
    Input('demo-dropdown', 'value')
)
def update_output(value):
    return f'You have selected {value}'

if __name__ == ' __main__':
    app.run_server(debug=True)
```

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [March 18, 2022, 7:17pm UTC](https://community.plotly.com/t/dash-typeerror-when-running-dropdown-example-code/62068/2 "2022-03-18T19:17:34Z")

</div>

Hi @rp1 and welcome to Dash 🙂

The examples in the dash docs uses syntax that was new as of dash version 2.1.0 . If you upgrade to the latest version, then the error will go away. You will also be able to use the more concise import statements:

instead of:

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

```

you can do this 🍰 :

```auto
from dash import Dash, dcc, html, Input, Output

```

---

<div class="post-metadata">

**Author:** ![rp1](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@rp1](https://community.plotly.com/u/rp1)\
**Post date:** [March 19, 2022, 10:34am UTC](https://community.plotly.com/t/dash-typeerror-when-running-dropdown-example-code/62068/3 "2022-03-19T10:34:05Z")

</div>

Thanks, I got it working 🙂
