But when I try the interactive view widget “slicernb.ViewInteractiveWidget()”, it showed “Error displaying widget: model not found”.
I don’t know if it is related to the failed installation of “pip_install(‘jupyterlab’)
slicer.util._executePythonModule(‘jupyter’,[‘labextension’,‘install’,’@jupyter-widgets/jupyterlab-manager’,‘ipycanvas’,‘ipyevents’])”.
AFAIK the interactive widget was made for the kernel to work in containers and with binder (@lassoan might correct me here). Those are environments where you don’t have direct access to the Slicer GUI. If you are using the local Slicer this interactivity is not expected to work inside the lab because you have full access to the actual Slicer GUI.
What is the environment you would like to set up? Are you using a local or a remote computer?
You can get interactive 3D views at multiple levels.
Level 1. View objects + standard widgets
Level 2. View widgets
Level 3. Interactive view widgets
Level 4. Remote application window view
Level 1-3 works locally, without having to set up a remote desktop server. Level 4 only makes sense when you don’t have access to the desktop where 3D Slicer is running (e.g., when the notebook server is a cloud computer that you don’t have remote desktop access to - such as Binder).