You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to draw anything using ipycanvas in JupyterLab, I'm getting a blank canvas displayed and no image data being stored even with sync_image_data = True. I'm not using Voila here, though the blank canvas display looks similar to #342 and I've tried the solution there.
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[8], line 10
7 canvas.clear_rect(45, 45, 60, 60)
8 canvas.stroke_rect(50, 50, 50, 50)
---> 10 canvas.get_image_data()
File [/opt/conda/lib/python3.11/site-packages/ipycanvas/canvas.py:444](https://teachinghub.st-andrews.ac.uk/opt/conda/lib/python3.11/site-packages/ipycanvas/canvas.py#line=443), in _CanvasBase.get_image_data(self, x, y, width, height)
435 """Return a NumPy array representing the underlying pixel data for a specified portion of the canvas.
436
437 This will throw an error if there is no ``image_data`` to retrieve, this happens when nothing was drawn yet or
(...)
441 are (``x + width``, ``y + height``).
442 """
443 if self.image_data is None:
--> 444 raise RuntimeError(
445 "No image data, please be sure that ``sync_image_data`` is set to True"
446 )
448 x = int(x)
449 y = int(y)
RuntimeError: No image data, please be sure that ``sync_image_data`` is set to True
This was caused by a version difference with the labextension which had previously been installed to ~/.local for some reason; apologies for the false report.
When trying to draw anything using
ipycanvas
in JupyterLab, I'm getting a blank canvas displayed and no image data being stored even withsync_image_data = True
. I'm not using Voila here, though the blank canvas display looks similar to #342 and I've tried the solution there.Versions are as follows:
Any help appreciated, and I'm happy to help get more details.
The text was updated successfully, but these errors were encountered: