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.

Displaying ipycanvas in google colab?

See original GitHub issue

Hello! I’m preparing a tutorial using ipycanvas, and while it works perfectly in my local jupyter installation, I can’t get the same code to display in google colab (for remote students).

I know this is much more likely to be a google colab issue than a ipycanvas issue, but I was wondering if you know any workarounds from experience?

This is the code that I’m trying to run.

from ipycanvas import Canvas
testipycanvas = Canvas(width = 20, height = 20)
testipycanvas.fill_style = "green"
testipycanvas.fill_rect(0,0,20)
display(testipycanvas)

(I have already !pip install’ed the module with no errors. The code above gives me a blank output with no error messages)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:29 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
martinRenoucommented, Mar 8, 2022

ipycanvas seems to work very nicely with Colab now thanks to @blois 's amazing work!

!pip install -q ipycanvas

from google.colab import output
output.enable_custom_widget_manager()

from ipycanvas import Canvas
testipycanvas = Canvas(width = 20, height = 20)
testipycanvas.fill_style = "green"
testipycanvas.fill_rect(0,0,20)
display(testipycanvas)

ipycanvascolab

2reactions
caranhacommented, Jan 6, 2021

Also apparently the correct issue on googlecolab about custom widget libraries is now on googlecolab/colabtools#498

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display Animations in Google Colab - python - Stack Overflow
Here are a couple things I've tried: ipycanvas. This is great in a local Jupyter notebook and is based on HTML5 canvas. It...
Read more >
ipycanvas: Interactive Canvas in Jupyter — ipycanvas ...
Try it online#. You can try ipycanvas, without the need of installing anything on your computer, using mybinder by clicking on this badge:....
Read more >
Google Colab - IPython.display! - YouTube
Tutorial on using the IPython. display object in Google Colab. IPython. display allows users to embed videos from YouTube and Vimeo into a ......
Read more >
ipycanvas: A Python Canvas for Jupyter | by Martin Renou
ipycanvas exposes the Canvas API to IPython, making it possible to draw anything you want on a Jupyter Notebook directly in Python!
Read more >
Hi! Thanks for the kind words.. Unfortunately it does ... - Medium
Google Colab lacks support for Interactive Widgets libraries like ipycanvas, you can follow the status of this issue…
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