Errors while running dash plotly code - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: Errors while running dash plotly code (/thread-4523.html) |
Errors while running dash plotly code - Nischitha - Aug-23-2017 Hello , I'm getting the following error while m running the below code in python shell directly, Can anyone please solve the problem: # -*- coding: utf-8 -*- import dash import dash_core_components as dcc import dash_html_components as html app = dash.Dash() app.layout = html.Div(children=[ html.H1(children='Hello Dash'), html.Div(children=''' Dash: A web application framework for Python. '''), dcc.Graph( id='example-graph', figure={ 'data': [ {'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'}, {'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'}, ], 'layout': { 'title': 'Dash Data Visualization' } } ) ]) if __name__ == "__main__": app.run_server(debug=True) Unexpected error: /opt/python/2.7.10/linux50_32/bin/python: can't find '__main__' module in '' ---------------------------------------------------------------------------- Thanks in advance RE: Errors while running dash plotly code - Larz60+ - Aug-23-2017 Use code tags see BBCODE when posting code, use ctrl-shift-v to eliminate formatting and maintain indentation please re-post RE: Errors while running dash plotly code - Nischitha - Aug-24-2017 Hello , I'm getting the error while m running the below code in python shell directly, Can anyone please solve the problem: import dash import dash_core_components as dcc import dash_html_components as html app = dash.Dash() app.layout = html.Div(children=[ html.H1(children='Hello Dash'), html.Div(children=''' Dash: A web application framework for Python. '''), dcc.Graph( id='example-graph', figure={ 'data': [ {'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'}, {'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montr?al'}, ], 'layout': { 'title': 'Dash Data Visualization' } } ) ]) if __name__ == '__main__': app.run_server(debug=True)---------------------------------------------------------------- Output: * Running on http://127.0.0.1:8050/ (Press CTRL+C to quit) * Restarting with stat /bin/python3.4: can't find '__main__' module in '' RE: Errors while running dash plotly code - Larz60+ - Aug-24-2017 Please post full (verbatim) errors from the one line that you supply, it sounds like there is no __main__ function which it is trying to run |