Unable to run jupyter dash in Google Colab
See original GitHub issueI would like to run jupyter-dash in google colab. However, it is not possible to do so based on the example notebook.
Running the notebook I get a blank iframe.
When I followed the steps for embedding iframe of a flask app into colab notebook described at: https://stackoverflow.com/questions/54465816/how-to-use-flask-in-google-colaboratory-python-notebook
I get empty charts:
If I rerun the app without the mode="inline"
I get the following error messages:
import IPython.display
def display_iframe(port, height):
shell = """
(async () => {
const url = await google.colab.kernel.proxyPort(%PORT%, {"cache": true});
console.log(`Adding ifram from URL:${url}`);
const iframe = document.createElement('iframe');
iframe.src = url;
iframe.setAttribute('width', '100%');
iframe.setAttribute('height', '%HEIGHT%');
iframe.setAttribute('frameborder', 0);
document.body.appendChild(iframe);
})();
"""
replacements = [
("%PORT%", "%d" % port),
("%HEIGHT%", "%d" % height),
]
for (k, v) in replacements:
shell = shell.replace(k, v)
script = IPython.display.Javascript(shell)
IPython.display.display(script)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Launch a Dash app in a Google Colab Notebook
unzip ngrok-stable-linux-amd64.zip ### Run ngrok to tunnel Dash app port 8050 to the outside world. ### This command runs in the background.
Read more >Share your Dash App on Google Colab and Kaggle - YouTube
Learn how to put your Dash Plotly app onto Google Colab and Kaggle, using Jupyter Dash. ... Your browser can't play this video....
Read more >Setting up Plotly Dash in JupyterLab & Jupyter Notebook
In this tutorial you'll learn to set up Jupyter Lab and Jupyter Notebook to run your Plotly Dash Apps, using PC or Mac....
Read more >16 Running Dash Apps - Introduction to Google Colab for ...
Introduction to Google Colaboratory for Research - 16 Running Dash Apps00:00:00 Introduction00:00:17 Dash Framework00:00:43 Jupyter ...
Read more >Problem running Dash in Google Colab notebook
I'm new to Plotly and am trying to use Dash. I found some sample code in an online tutorial and have tried to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It doesn’t still work in Colab.
Gives the following error: AttributeError: (‘Read-only: can only be set in the Dash constructor or during init_app()’, ‘requests_pathname_prefix’)
Colab support added in https://github.com/plotly/jupyter-dash/pull/27 and released in version 0.3.0