vispy / jupyter_rfb

Remote Frame Buffer for Jupyter
https://jupyter-rfb.readthedocs.io
MIT License
55 stars 10 forks source link

Running in collab notebooks? #57

Closed kushalkolar closed 1 year ago

kushalkolar commented 2 years ago

Do you think there's any way to get this running in a collab notebook? Ideas on how to possibly do this would be great too!

djhoese commented 2 years ago

Have you tried it? Does it give an error?

If jupyter_rfb is installed on the kernel (the python environment) then it should be fine...I would think.

almarklein commented 2 years ago

I think it should work.

kushalkolar commented 2 years ago

Sorry I should've provided more details. The hello_world.ipynb example only outputs the initial snapshot in collab. It's the same regardless of runtime type (GPU,TPU, or None (which I'm assuming is just CPU)).

image

jupyter_rfb and pygfx are installed using !pip in the first cell:

!pip install -U jupyter_rfb
!pip install -U pygfx

The pygfx1.ipynb example crashes the notebook kernel with the following runtime log using RUST_BACKTRACE=full

I'm guessing that "thread '<unnamed>' panicked at 'Unable to request adapter: NotFound', src/device.rs:49:10" at the very start of the log (at the very bottom of this block) is the biggest hint?

Timestamp,Level,Message
"Apr 13, 2022, 10:31:42 AM",WARNING,WARNING:root:kernel 9289f15e-33bd-46ca-8060-9a07baf3dc7a restarted
"Apr 13, 2022, 10:31:42 AM",INFO,"KernelRestarter: restarting kernel (1/5), keep random ports"
"Apr 13, 2022, 10:31:39 AM",WARNING,"fatal runtime error: failed to initiate panic, error 5"
"Apr 13, 2022, 10:31:39 AM",WARNING, 117:     0x55e8a9d9bd0a - _start
"Apr 13, 2022, 10:31:39 AM",WARNING, 116:     0x7ffa19180c87 - __libc_start_main
"Apr 13, 2022, 10:31:39 AM",WARNING, 115:     0x55e8a9d9be2c - _Py_UnixMain
"Apr 13, 2022, 10:31:39 AM",WARNING, 114:     0x55e8a9d9c1ba - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING, 113:     0x55e8a9d9e5a1 - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING, 112:     0x55e8a9bcceb0 - _PyFunction_FastCallDict
"Apr 13, 2022, 10:31:39 AM",WARNING, 111:     0x55e8a9cfaa2e - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING, 110:     0x55e8a9cfb8f6 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING, 109:     0x55e8a9c8d88a - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING, 108:     0x55e8a9cfaa2e - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING, 107:     0x55e8a9cff9a3 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING, 106:     0x55e8a9c8bef0 - _PyCFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,55e8a9c8bff9 - _PyMethodDef_RawFastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING, 105:     0x
"Apr 13, 2022, 10:31:39 AM",WARNING, 104:     0x55e8a9cf8bd0 - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING, 103:     0x55e8a9cfa723 - PyEval_EvalCode
"Apr 13, 2022, 10:31:39 AM",WARNING, 102:     0x55e8a9cfaa2e - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING, 101:     0x55e8a9cffd30 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING, 100:     0x55e8a9c8d88a - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  99:     0x55e8a9cfaa2e - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  98:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  97:     0x55e8a9c8d7aa - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  96:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  95:     0x55e8a9c8d7aa - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  94:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  93:     0x55e8a9c8d7aa - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  92:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  91:     0x55e8a9c8d7aa - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  90:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  89:     0x55e8a9c8d7aa - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  88:     0x55e8a9d01464 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  87:     0x55e8a9c8e49a - PyCFunction_Call
"Apr 13, 2022, 10:31:39 AM",WARNING,  86:     0x55e8a9da1868 - _PyMethodDef_RawFastCallDict
"Apr 13, 2022, 10:31:39 AM",WARNING,  85:     0x55e8a9dc35b1 - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING,  84:     0x55e8a9c8c902 - _PyObject_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  83:     0x55e8a9c8dce9 - _PyObject_Call_Prepend
"Apr 13, 2022, 10:31:39 AM",WARNING,_PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  82:     0x55e8a9cffc4d - 
"Apr 13, 2022, 10:31:39 AM",WARNING,  81:     0x55e8a9c8c902 - _PyObject_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  80:     0x55e8a9dfd819 - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING,  79:     0x55e8a9c8c4fb - _PyObject_FastCallDict
"Apr 13, 2022, 10:31:39 AM",WARNING,  78:     0x55e8a9cfacdd - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  77:     0x55e8a9cfcff1 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  76:     0x55e8a9bcceb0 - _PyFunction_FastCallDict
"Apr 13, 2022, 10:31:39 AM",WARNING,  75:     0x55e8a9cfacdd - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  74:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  73:     0x55e8a9c8d7aa - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  72:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  71:     0x55e8a9c8d7aa - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  70:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  69:     0x55e8a9c8d88a - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  68:     0x55e8a9cfaa2e - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  67:     0x55e8a9cfcff1 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  66:     0x55e8a9bcceb0 - _PyFunction_FastCallDict
"Apr 13, 2022, 10:31:39 AM",WARNING,  65:     0x55e8a9cfacdd - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  64:     0x55e8a9cfcff1 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  63:     0x55e8a9bcceb0 - _PyFunction_FastCallDict
"Apr 13, 2022, 10:31:39 AM",WARNING,  62:     0x55e8a9cfacdd - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  61:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  0x55e8a9c8d7aa - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  60:   
"Apr 13, 2022, 10:31:39 AM",WARNING,  59:     0x55e8a9cfb8f6 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  58:     0x55e8a9c8d7aa - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  57:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  56:     0x55e8a9c8d88a - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  55:     0x55e8a9cfaa2e - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  54:     0x55e8a9cfc719 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  53:     0x55e8a9c8d88a - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  52:     0x55e8a9cfacdd - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  51:     0x55e8a9cfcff1 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  50:     0x55e8a9c8e341 - PyObject_Call
"Apr 13, 2022, 10:31:39 AM",WARNING,  49:     0x55e8a9c8e13c - _PyObject_Call_Prepend
"Apr 13, 2022, 10:31:39 AM",WARNING,  48:     0x55e8a9cfacdd - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  47:     0x55e8a9cfc719 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  46:     0x55e8a9c8d88a - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  45:     0x55e8a9cfaa2e - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  44:     0x55e8a9cfbb4f - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  43:     0x55e8a9c8d88a - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  42:     0x55e8a9cfaa2e - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  41:     0x55e8a9cff9a3 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  40:     0x55e8a9c8bef0 - _PyCFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  39:     0x55e8a9c8bff9 - _PyMethodDef_RawFastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING, - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING,  38:     0x55e8a9cf8bd0
"Apr 13, 2022, 10:31:39 AM",WARNING,  37:     0x55e8a9cfa723 - PyEval_EvalCode
"Apr 13, 2022, 10:31:39 AM",WARNING,  36:     0x55e8a9cfaa2e - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  35:     0x55e8a9d00522 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  34:     0x55e8a9c8c902 - _PyObject_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  33:     0x55e8a9ccc184 - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING,  32:     0x55e8a9ccf239 - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING,  31:     0x55e8a9c8df21 - _PyObject_Call_Prepend
"Apr 13, 2022, 10:31:39 AM",WARNING,  30:     0x55e8a9cfacdd - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  29:     0x55e8a9cffc4d - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  28:     0x55e8a9c8c902 - _PyObject_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  27:     0x55e8a9ccc184 - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING,  26:     0x55e8a9ccf239 - <unknown>
"Apr 13, 2022, 10:31:39 AM",WARNING,  25:     0x55e8a9c8dce9 - _PyObject_Call_Prepend
"Apr 13, 2022, 10:31:39 AM",WARNING,  24:     0x55e8a9cfc719 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  23:     0x55e8a9c8d88a - _PyFunction_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,  22:     0x55e8a9cfacdd - _PyEval_EvalCodeWithName
"Apr 13, 2022, 10:31:39 AM",WARNING,  21:     0x55e8a9d00522 - _PyEval_EvalFrameDefault
"Apr 13, 2022, 10:31:39 AM",WARNING,  20:     0x55e8a9c8c902 - _PyObject_FastCallKeywords
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /tmp/pip-req-build-1spynmhm/c/_cffi_backend.c:3186:5
"Apr 13, 2022, 10:31:39 AM",WARNING,  19:     0x7ff9ff53d737 - cdata_call
"Apr 13, 2022, 10:31:39 AM",WARNING,  18:     0x7ff9ff319c07 - ffi_call_int
"Apr 13, 2022, 10:31:39 AM",WARNING,  17:     0x7ff9ff31b052 - ffi_call_unix64
"Apr 13, 2022, 10:31:39 AM",WARNING,  16:     0x7ff9fe9d3e7b - wgpuInstanceRequestAdapter
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/result.rs:1616:5
"Apr 13, 2022, 10:31:39 AM",WARNING,::result::unwrap_failed::h32ef6b3156e8fc57
"Apr 13, 2022, 10:31:39 AM",WARNING,  15:     0x7ff9fe947743 - core
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
"Apr 13, 2022, 10:31:39 AM",WARNING,  14:     0x7ff9fe947651 - core::panicking::panic_fmt::h23b9203e89cc61cf
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
"Apr 13, 2022, 10:31:39 AM",WARNING,  13:     0x7ff9fec788e9 - rust_begin_unwind
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:139:18
"Apr 13, 2022, 10:31:39 AM",WARNING,  12:     0x7ff9fec77544 - std::sys_common::backtrace::__rust_end_short_backtrace::h9b3efa22a5768c0f
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:521:13
"Apr 13, 2022, 10:31:39 AM",WARNING,  11:     0x7ff9fec78980 - std::panicking::begin_panic_handler::{{closure}}::h9371c0fbb1e8465a
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:624:17
"Apr 13, 2022, 10:31:39 AM",WARNING,  10:     0x7ff9fec78ea4 - std::panicking::rust_panic_with_hook::h50680ff4b44510c6
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:227:9
"Apr 13, 2022, 10:31:39 AM",WARNING,   9:     0x7ff9fec783a5 - std::panicking::default_hook::h341c1030c6a1161b
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:210:50
"Apr 13, 2022, 10:31:39 AM",WARNING,   8:     0x7ff9fec787f0 - std::panicking::default_hook::{{closure}}::h6fac9ac9c8b79e52
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:36:9
"Apr 13, 2022, 10:31:39 AM",WARNING,   7:     0x7ff9fec787f0 - std::sys_common::backtrace::print::h335a66af06738c7c
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:49:5
"Apr 13, 2022, 10:31:39 AM",WARNING,   6:     0x7ff9fec787f0 - std::sys_common::backtrace::_print::hcc197d4bebf2b369
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/io/mod.rs:1696:15
"Apr 13, 2022, 10:31:39 AM",WARNING,   5:     0x7ff9fec74eb5 - std::io::Write::write_fmt::h71ddfebc68685972
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/fmt/mod.rs:1163:17
"Apr 13, 2022, 10:31:39 AM",WARNING,write::h2a1462b5f8eea807
"Apr 13, 2022, 10:31:39 AM",WARNING,   4:     0x7ff9fec9845c - core::fmt::
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:46:22
"Apr 13, 2022, 10:31:39 AM",WARNING,   3:     0x7ff9fec7709c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h231c4190cfa75162
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:67:5
"Apr 13, 2022, 10:31:39 AM",WARNING,   2:     0x7ff9fec7709c - std::sys_common::backtrace::_print_fmt::hb16700db31584325
"Apr 13, 2022, 10:31:39 AM",WARNING,                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
"Apr 13, 2022, 10:31:39 AM",WARNING,   1:     0x7ff9fec7709c - std::backtrace_rs::backtrace::trace_unsynchronized::hc596a19e4891f7f3
"Apr 13, 2022, 10:31:39 AM",WARNING,                         at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
"Apr 13, 2022, 10:31:39 AM",WARNING,   0:     0x7ff9fec7709c - std::backtrace_rs::backtrace::libunwind::trace::hf6a6dfd7da937cb0
"Apr 13, 2022, 10:31:39 AM",WARNING,stack backtrace:
"Apr 13, 2022, 10:31:39 AM",WARNING,"thread '<unnamed>' panicked at 'Unable to request adapter: NotFound', src/device.rs:49:10"
"Apr 13, 2022, 10:31:24 AM",INFO,Kernel restarted: 9289f15e-33bd-46ca-8060-9a07baf3dc7a
kushalkolar commented 2 years ago

Some progress, using !apt install mesa-vulkan-drivers in the first jupyter cell prevents the kernel from crashing! Still only see an initial snapshot.

almarklein commented 2 years ago

I'd recommend starting with a simple example that does not use pygfx or vispy. Otherwise the problem might also be in the availability of the graphics API on the server. So indeed the hello world and interaction examples would be a good start.

I don't know much about the colab notebook. Is this like a normal notebook except you connect multiple clients to the same kernel?

I wonder if there's documentation how custom ipywidget's can support it ...

kushalkolar commented 2 years ago

The hello_world example does run but only shows the initial snapshot, it is not interactable. Similar for the ipywidgets_embed example.

I wonder what's special about binder because the simple examples do run interactively on there. The interactivity doesn't work on Saturn Cloud either and that's also jupyter lab notebooks.

Google Colab is notebooks similar to jupyter notebook, not sure exactly what makes them different from regular jupyter notebooks.

almarklein commented 2 years ago

Another thing to try is using a simple ipywidgets example (without jupyter_rfb). If these do work, we could investigate the differences.

kushalkolar commented 2 years ago

I did try the ipywidgets example. ipywidgets themselves work in colab without issues and this is officially documented.

However, the rfb just shows the initial snapshot. Moving the slider doesn't interactively update it, but re-executing the cell to display the rfb shows that something is happening but it's only showing the snapshot in the output.

https://user-images.githubusercontent.com/9403332/163288186-75ee7595-8c36-4fab-9bd6-1461361618fa.mp4

almarklein commented 2 years ago

It looks like this needs some deeper examination then. I don't have the time to do this right now though.

almarklein commented 2 years ago

This also relates to #53

manics commented 2 years ago

This some relevant discussion in https://discourse.jupyter.org/t/feature-idea-a-specification-for-notebook-output-dependencies/8428

almarklein commented 1 year ago

With #67 it is likely that this issue is now also fixed. If someone can confirm (or deny) that'd be great 👍

kushalkolar commented 1 year ago

with v0.3.3 it produces no output in collab. Collab prompts up a thing for third-party jupyter widgets, but adding the output.enable_custom_widget_manager() doesn't make a difference, so I think it has to be added to their CDN to work.

image

tried with ipywidgets v7 and v8

almarklein commented 1 year ago

Cells for a minimal example:

!pip install -U jupyter_rfb
# Any non-standard widget must be enabled like this
from google.colab import output
output.enable_custom_widget_manager()
import numpy as np
import jupyter_rfb
jupyter_rfb.__version__
class HelloWorld1(jupyter_rfb.RemoteFrameBuffer):
    def get_frame(self):
        a = np.zeros((100, 100, 3), np.uint8)
        a[20:-20,20:-20,1] = 255
        return a

w = HelloWorld1()
w
almarklein commented 1 year ago

Running the above does not work for me either. In the dev console it shows:

Error has occurred while trying to update output. 
...
Widget jupyter_rfb RemoteFrameBufferModel is not supported" }

The docs say about custom widgets:

image

It apparently loads stuff from a CDN. But which one? And how do we get our stuff in it? I'm leaving this for someone else to look into.

kushalkolar commented 1 year ago

It apparently loads stuff from a CDN. But which one? And how do we get our stuff in it? I'm leaving this for someone else to look into.

I think this is the repo for the CDN: https://github.com/googlecolab/colab-cdn-widget-manager

kushalkolar commented 1 year ago

Collab has triaged it, I'll look for other options for teaching (that's what collab is really useful for). There's a bunch of other things and widgets that don't work properly in collab anyways. Since jupyter_rfb now works in vscode that opens other options :)

https://github.com/googlecolab/colabtools/issues/3462