question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

push_notebook does not work in Google Colaboratory

See original GitHub issue

Hello!

I tried to create an interactive plot with bokeh in Google Colab. The following code renders a scatter plot as expected:

from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from bokeh.io import output_notebook, push_notebook, show
import numpy as np

output_notebook(hide_banner=True)

source = ColumnDataSource(data=dict(x=np.random.rand(10), y=np.random.rand(10)))
p = figure(output_backend="webgl")
scatter = p.scatter(source=source, x='x', y='y')
handle = show(p, notebook_handle=True)

Changing the data and calling push_notebook should change the positions of the points in the scatter plot:

scatter.data_source.data['x'] = np.random.rand(10)
scatter.data_source.data['y'] = np.random.rand(10)
push_notebook(handle)

Instead, the notebook crashes (“Runtime disconnected”). This happens with bokeh version 1.3.4. You can find a demo of the problem here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
bloiscommented, Apr 7, 2020

I am working on this on two fronts right now-

Once the binary comms plumbing is in Colab we should be able to either expose some globals in the environment or if the above jupyter-output-spec stabilizes and is acceptable then implement that.

1reaction
philippjfrcommented, May 14, 2020

I’m working up a PR to add support for those comms to bokeh (and the HoloViz stack). I’ll reopen this issue since the ball is now in our court.

Read more comments on GitHub >

github_iconTop Results From Across the Web

push_notebook does not work in Google Collab Jupyter ...
1 Answer 1 ... push_notebook does not and cannot work on Google Collab due to the fact that Google's notebook implementation will not...
Read more >
Troubleshooting Google Colab for the Total Newbie
Working in Google Colab for the first time has been completely awesome and pretty shockingly easy, but it hasn't been without a couple...
Read more >
What is Google Colab? - Medium
Colab is basically a free Jupyter notebook environment running wholly in the cloud. Most importantly, Colab does not require a setup, plus the...
Read more >
How to Upload Project on GitHub from Google Colab?
One can use Google Colab to develop machine learning projects and can easily upload them in Github by following the below steps: Open...
Read more >
Complete Beginner's Tutorial to Google Colab - YouTube
Notebook available here: https:// colab.research. google.com/drive/1g7_rzcvOEIUjXLJqorcTcaQc5ng0RNPn?usp=sharingRoadmap to Become a Data ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found