Dcc dropdown menu not working

So for some reason unknown to me, the dropdown menu shows up empty. I have no idea what is going on. I’ve tried in different browsers (chrome,firefox,Pale) According to the the documentation I should have an issue, but yet. Any advice would be appreciated.

I’m running dcc version 1.0.0.

Thanks in advance

code below:

import dash_core_components as dcc
dcc.Dropdown(
options=[
{‘label’: ‘New York City’, ‘value’: ‘NYC’},
{‘label’: ‘Montréal’, ‘value’: ‘MTL’},
{‘label’: ‘San Francisco’, ‘value’: ‘SF’}
],
value=‘MTL’
)

if name==‘main’:
app.run_server()

This minimal example works fine for me, what do you see?

import dash
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash(__name__)

app.layout = html.Div(
    dcc.Dropdown(
        options=[
            {'label': 'New York City', 'value': 'NYC'},
            {'label': 'Montréal', 'value': 'MTL'},
            {'label': 'San Francisco', 'value': 'SF'}
        ],
        value='MTL'
    )
)

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

I see an empty dropbox

Something is wrong with your environment then.

  1. What version of all of your Dash libraries are you using (dash, dash-renderer, dash-core-components, dash-html-components, plotly)? You can use pip listto figure it out

  2. How are you starting Dash? Command line? iPython? etc…

  3. With debug=True do you see any errors?

  1. i’m using the following Dash libraries:
    dash 1.0.0
    dash-core-components 1.0.0
    dash-daq 0.1.0
    dash-html-components 1.0.0
    dash-renderer 1.0.0
    dash-table 4.0.0

  2. I’m starting dash in an anaconda environment using either jupyter notebook and jupyter labs.

  3. when I run app.run_server(debug=True) the pages never loads the page for any of my Dash projects (3 hours waiting so far) so I just run app.run_server().

I resolved the issue by…well i made a new environment and deleted old one and it was fine. Still no idea why it happened.

1 Like