# Error loading dependencies in using Button Callback

**URL:** <https://community.plotly.com/t/error-loading-dependencies-in-using-button-callback/19770>\
**Category:** Dash Python\
**Created:** [February 19, 2019, 10:28am UTC](https://community.plotly.com/t/error-loading-dependencies-in-using-button-callback/19770 "2019-02-19T10:28:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![naser](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@naser](https://community.plotly.com/u/naser)\
**Post date:** [February 19, 2019, 10:28am UTC](https://community.plotly.com/t/error-loading-dependencies-in-using-button-callback/19770/1 "2019-02-19T10:28:37Z")

</div>

Hi,  
I am trying to run one of Dash basic examples. This is the code:

```
import dash
import dash_html_components as html
import dash_core_components as dcc

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash( __name__ , external_stylesheets=external_stylesheets)
app.layout = html.Div([
    html.Div(dcc.Input(id='input-box', type='text')),
    html.Button('Submit', id='button'),
    html.Div(id='output-container-button',
             children='Enter a value and press submit')
])

@app.callback(
    dash.dependencies.Output('output-container-button', 'children'),
    [dash.dependencies.Input('button', 'n_clicks')],
    [dash.dependencies.State('input-box', 'value')])
def update_output(n_clicks, value):
    return 'The input value was "{}" and the button has been clicked {} times'.format(
        value,
        n_clicks
    )

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

```

but when I want to connect to dash, I get the “Error loading dependencies” error.

I installed dash components with commands from here: [https://dash.plot.ly/installation](https://dash.plot.ly/installation)

---

<div class="post-metadata">

**Author:** ![nedned](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/nedned/32/8795_2.png) [@nedned](https://community.plotly.com/u/nedned)\
**Post date:** [February 20, 2019, 12:28am UTC](https://community.plotly.com/t/error-loading-dependencies-in-using-button-callback/19770/2 "2019-02-20T00:28:43Z")

</div>

You might have an out of date Dash dependency. They are now all locked to the correct versions, so do `pip install -U dash` and try again.

---

<div class="post-metadata">

**Author:** ![mini\_geek](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mini\_geek](https://community.plotly.com/u/mini_geek)\
**Post date:** [February 20, 2019, 5:38pm UTC](https://community.plotly.com/t/error-loading-dependencies-in-using-button-callback/19770/3 "2019-02-20T17:38:42Z")

</div>

Hi! I have the similar issue, even after pip install -U dash.  
I continue getting:

syntax error external\_stylesheets = [‘[https://codepen.io/chriddyp/pen/bWLwgP.css](https://codepen.io/chriddyp/pen/bWLwgP.css)’]

even when using the same code as the sample reference page. Here’s the code (and link) I copied/pasted to test if it works in jupyter. Am I missing something?

Thanks in advance!

page link: must add https dash.plot.ly/dash-core-components/dropdown

import dash  
import dash\_html\_components as html  
import dash\_core\_components as dcc

external\_stylesheets = [‘[https://codepen.io/chriddyp/pen/bWLwgP.css](https://codepen.io/chriddyp/pen/bWLwgP.css)’]

app = dash.Dash( **name** , external\_stylesheets=external\_stylesheets)  
app.layout = html.Div([  
dcc.Dropdown(  
id=‘my-dropdown’,  
options=[  
{‘label’: ‘New York City’, ‘value’: ‘NYC’},  
{‘label’: ‘Montreal’, ‘value’: ‘MTL’},  
{‘label’: ‘San Francisco’, ‘value’: ‘SF’}  
],  
value=‘NYC’  
),  
html.Div(id=‘output-container’)  
])

@app.callback(  
dash.dependencies.Output(‘output-container’, ‘children’),  
[dash.dependencies.Input(‘my-dropdown’, ‘value’)])  
def update\_output(value):  
return ‘You have selected “{}”’.format(value)

if **name** == ‘ **main** ’:  
app.run\_server(debug=True)

---

<div class="post-metadata">

**Author:** ![nedned](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/nedned/32/8795_2.png) [@nedned](https://community.plotly.com/u/nedned)\
**Post date:** [February 21, 2019, 3:42am UTC](https://community.plotly.com/t/error-loading-dependencies-in-using-button-callback/19770/4 "2019-02-21T03:42:21Z")

</div>

Dash doesn’t work with Jupyter out of the box. There’s a few projects that can help make that work. Plotly has one for Jupyter lab ([https://github.com/plotly/jupyterlab-dash](https://github.com/plotly/jupyterlab-dash)) and there’s also this one: [https://github.com/GibbsConsulting/jupyter-plotly-dash](https://github.com/GibbsConsulting/jupyter-plotly-dash)

Perhaps try just running with Python directly and then see if you have the issue first.

---

<div class="post-metadata">

**Author:** ![mini\_geek](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mini\_geek](https://community.plotly.com/u/mini_geek)\
**Post date:** [February 21, 2019, 8:11am UTC](https://community.plotly.com/t/error-loading-dependencies-in-using-button-callback/19770/5 "2019-02-21T08:11:38Z")

</div>

Thanks! i’ll give it a go
