✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

"Loading..." when opening localhost

I’m completely new to plotly/dash, therefore likewise to the User Guide. I installed all dash and plotly related stuff as described. I copied the code, created app.py and let it run. Opening localhost on port 8050 as described doesn’t give me the simple Hello Dash example. All I see is a white window with “Loading…” at the top left corner.
I’m using python 2 with anaconda on Ubuntu 16.04.
I tried disabling ad-block as described in some forum, didn’t help.
I set the debug mode = False, didn’t help.
Re-installing and/or rebooting didn’t help.
Any suggestions? Thanks

The console output is:
$ python app.py

  • Running on http://127.0.0.1:8050/ (Press CTRL+C to quit)
    127.0.0.1 - - [12/Dec/2017 16:58:25] “GET / HTTP/1.1” 200 -

@amitter - Could you open up your browser’s dev tools and look at the console? You’ll likely see an error message there.

I suspect that this is related to the JS assets from the CDN not loading properly - perhaps because they are blocked by your firewall or some other reason.

You can load the assets locally by setting:

app.scripts.config.serve_locally = True
app.css.config.serve_locally = True

anywhere in your code.

console output:

thanks, the local approach works.

1 Like

Hi,

I have the same Problem (Loading… on the top), but adding the two lines didn’t fix it.
I’m running python on Spyder with Anaconda.
Could you please help? Thanks

@chriddyp I’m also having the same issue and adding the two lines didn’t fix it for me as well. I’m on Mac OSX 10.12.6. I used to be able to run simple plotly dash pages just fine several months ago, but now I can’t get them to work. I also don’t see any console output or errors when I open the dev console. Any thoughts on how to debug this?

I figured out my problem! @nahal626 this might fix your problem too. My problems happened when I used versions of the dash helper packages that were newer than the dash package. If you specify dash=0.37.0 when you install with conda, it should work out. So for example, it should work if you create a new environment with conda env update -f environment.yaml, where environment.yaml looks like this:

name: dash-test
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.7
  - dash=0.37.0 

If you look at the different versions of dash provided by conda using conda search dash --info, you’ll get a list of a bunch of versions, and the latest one looks like this:

dash 0.37.0 py_0
----------------
file name   : dash-0.37.0-py_0.tar.bz2
name        : dash
version     : 0.37.0
build       : py_0
build number: 0
size        : 38 KB
license     : MIT
subdir      : noarch
url         : https://conda.anaconda.org/conda-forge/noarch/dash-0.37.0-py_0.tar.bz2
md5         : cddf17a399c6a0fc1778dc14496cfcc5
timestamp   : 2019-02-19 06:02:53 UTC
dependencies:
  - dash-core-components 0.43.1
  - dash-html-components 0.13.5
  - dash-renderer 0.18.0
  - dash-table 3.4.0
  - flask >=0.12
  - flask-compress
  - plotly
  - python

It’s unique in that it’s the only one that specifies exact versions of the dash helper packages, so if you make sure to specify dash=0.37.0 you should get those versions that are compatible. Or just check to make sure the versions of your dash-* packages match the versions listed above. I also tested older versions of dash and found that the hello world code works fine as long as I was using helper packages that came out at around the same time as any given dash release.

By making sure to use a compatible set of packages, I didn’t have to do the serve_locally stuff either. Hope this helps!

What browser are you using? My problem was solved when I switched from Internet Explorer 11 to Chrome

I’ve been using Chrome the whole time so I guess our problems were different. Glad you fixed yours!

I’ve been using this library consistently for the last few weeks. It was working just an hour ago. I just rebuilt my virtual environment from scratch and now I cannot proceed past the “Loading…” message. I’m running Mac OS High Sierra (10.13.6), python 3.6.4.

I was previously using dash==0.36.0. When I upgraded to dash==0.39.0 it worked.

Could you share a small, reproducable example?

For me the issue was that when I tried to update dash from 0.39 to the version 1.0.2, all my components etc updated but dash itself failed to update due to an issue with pyyaml not uninstalling. After uninstalling dash, I got through this by simply ignoring pyyaml by using:

pip install dash --ignore-installed PyYAML

I’m facing the same problem. I’ve tried a lot of troubleshooting and simplifying. Here’s my best shot at describing where I stand. Any suggestions?

The problem:
I have an apache webserver running on a raspberry pi and I’d like to make a plotly dash page available. For now, I’m trying to host it at http://<ip_of_pi>/flask. Here’s what I see when accessing from my laptop with google Chrome (I also tried Safari):

I’ve tried to strip the dash app down to the bare minimum. Here’s the code:

breaking this into parts to avoid the image limit…

When I run it directly from the command line on the pi, it runs as expected on port 8050:

python dash_app.py

And here’s what I see on my laptop:

I also created a much simpler flask-based app and I’m able to successfully host it. Here’s the WSGI file that I’m using to toggle between the dash app and the basic flask app:

with the line for flask_hello uncommented, I can successfully run the following very basic flask app at http://<ip_of_pi>/flask

image

here’s the result:

A couple more points of reference:
This is running in python 2.7 on my pi (I haven’t yet figured out how to make apache/wsgi use anything other than the base python. Any tips on how to configure it to run from a python 3 conda environment?)

Here’re the dash versions as installed by pip:

$pip list | grep dash
dash (1.1.1)
dash-core-components (1.1.1)
dash-daq (0.1.7)
dash-html-components (1.0.0)
dash-renderer (1.0.0)
dash-table (4.1.0)

And here’s the relevant part of my /etc/apache2/sites-enabled/000-default.conf file

    WSGIDaemonProcess webtool user=pi group=pi threads=5 home=/var/www/html/flask/
    WSGIScriptAlias /flask /var/www/html/flask/app.wsgi

    <directory /var/www/html/flask>
    WSGIProcessGroup webtool
    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptReloading On
    Order deny,allow
    Allow from all
    </directory>

And to summarize:

  • I can host a flask app through apache at <ip_of_pi>/flask
  • I can host a dash app by running at the command line at <ip_of_pi>:8050
  • But I CANNOT host a dash app using apache at <ip_of_pi>/flask. I only see “Loading…”

Any tips? Hopefully that’s enough info to diagnose! I can’t think of anything else to try.

I was experiencing the same problem running the ‘Hello Dash’ script from the tutorials from Spyder (Anaconda).

I realised that when copying the IP address with CTRL+C I was cancelling the process before I accessed the website.

Not sure if anybody is as stupid as me, but check if you are doing this as well.

I’m posting my worthless “me too” reply in the hopes that somebody who follows this thread actually has an answer by now.
I have the same problem when using CGI in Apache. Flask app in apache OK. Dash app cmd line OK. Dash app in apache no go, Ijust get “Loading …”.

I have a tip on running with Python 3.x, even though Apache is running 2.7.x.
Create your virtualenv (with Conda or other). Then I used CGI. Here is my CGI script (I am unable to install mod_wsgi on our server).

#!/home/jkhyrsmy/venv36/weather/bin/python
# Python virtualenv must be activated
activate_this = '/home/jkhyrsmy/venv36/weather/bin/activate_this.py'

with open(activate_this) as f:
    code = compile(f.read(), activate_this, 'exec')
    exec(code, dict(__file__=activate_this))

from wsgiref.handlers import CGIHandler

from dash_test import app

CGIHandler().run(app.server)

You have to specify the python interpreter from your virtual env. Then your app can truly run in Python 3 - except for the issue that we are discussing here!

Did anyone figure out how to fix Loading issue. Trying to makr dash work on RHEL8 . reached till here. mod wsgi work but now Dash gives loading error

I’d recommend opening your browser’s network console and looking at the (failed) requests