Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Dash in offline mode without internet . show loding.. only with no graphs

hello my problem is

i don’t see any plot in page just loading… and no graphs is shown!

my python version is :Anaconda 3 Python 3.6.4
my server :centos7 with no internet access

steps
first i installed dash all sources and python setup.py install all of them

install dash==0.22.0 # The core #dash dash backend
install dash-renderer==0.13.0 # The #dash dash front-end
install dash-html-components==0.11.0 # HTML components
install dash-core-components==0.26.0 # Supercharged components
install plotly the latest version

then i take the code from dash examples

import dash
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash()

# Force offline usage (also fails to render graph, issue #46)
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True

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,host = '0.0.0.0',port=5001)

then i retry to do assets folder and put
custom-script.js header.css typography.css

put still not show anything just loading…

i try to open page with many browser like chrome and Firefox and internet exp but still show loading…

[link for this Issue IN stackOverflow]
how can i resolve this issue

Hello,

Could someone give any solution to it. I'm not making any progress too as described above. Coincidentally on the same day we are on the same page.

Thanks.

the link for the same issue in stackoverflowlink here

@chriddyp:upside_down_face: any help plz

Hey, try the below… it worked for me:

Part 1:
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from pandas_datareader import data as web
from datetime import datetime as dt

Part 2:
install : pip install pandas_datareader

Part 3:In the last step of the script, try the below:

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

it will take the default local host as http://127.0.0.1:8050/

Part 4:
Change the first line in fred.py which would be in …\site-packages\pandas_datareader

from pandas.core.common import is_list_like
to
from pandas.api.types import is_list_like

I hope this would help you. It worked for me. Let me know your comments

if name == ‘main’:
you mean like that ?

No you’ve to use the underscore just like how you’ve tried in your code… for some reason, I don’t know its not showing in here… the one you’ve is fine, don’t change in the first line of if step, just make the change in the 2nd line of if step

still the same problem

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from pandas_datareader import data as web
from datetime import datetime as dt
app = dash.Dash()

# Serve files locally
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True

app.layout = html.Div(
    [ html.H1("This is a test")]
)

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


conf

try to test the code i send to see if it work with you or no

its normally taking much of the time to load, I got the output then. wait for some time and check after some time… and yes share the code , let me try

1 Like

also, did you changed as said in part 4 too, pls confirm

1 Like

yes i do the part 4
conf

Not sure why! may be you shall share the code if possible

are you using dash open source offline and free or not?
and the python version you used and are your server or machine you run the code is have a internet connection or no ?

the code that i test is below

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from pandas_datareader import data as web
from datetime import datetime as dt
app = dash.Dash()

# Serve files locally
app.scripts.config.serve_locally = True
app.css.config.serve_locally = True

app.layout = html.Div(
    [ html.H1("This is a test")]
)

if __name__ == '__main__':
    app.run_server(debug=True,host = '0.0.0.0',port=5001)

then i used your code

app.run_server()

Are you using chrome?

If so press F12 and go to console, are there any errors there?

If your not using chrome find out how to get the Javascript console up in your browser.

If your using a very old version of your browser Dash may not work.

2 Likes

thank you i already solve it by uninstall dash-renderer 0.13.0 and install it again i realized that when i open monitor network ther is no GET for dash-layout or dash-dependencies so i try to uninstall dash-renderer 0.13.0 and install it again and its work now thank you @Naresh for your help and thank you @mikesmith1611

1 Like

YW… Good that. Keep going!

1 Like