# Example Jupyter notebook not compatible with slicer 5.6

**URL:** https://discourse.slicer.org/t/example-jupyter-notebook-not-compatible-with-slicer-5-6/35121
**Category:** Support
**Tags:** python, jupyter
**Created:** [March 27, 2024, 10:07am UTC](https://discourse.slicer.org/t/example-jupyter-notebook-not-compatible-with-slicer-5-6/35121 "2024-03-27T10:07:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Matteboo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/matteboo/32/66548_2.png) [@Matteboo](https://discourse.slicer.org/u/Matteboo)
#### Post date: [March 27, 2024, 10:07am UTC](https://discourse.slicer.org/t/example-jupyter-notebook-not-compatible-with-slicer-5-6/35121/1 "2024-03-27T10:07:30Z")

</div>

Hello,  
I started to learn how to use slicer from Jupyter. I’ve used the example notebook provided here [GitHub - Slicer/SlicerNotebooks: Examples that illustrate how to use 3D Slicer via Jupyter notebooks in Python](https://github.com/Slicer/SlicerNotebooks)

However, some cells don’t work on my installation. For example, in the notebook 1.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/a/1a7fcd4335a402227fb783bde1e8267c1f8f1373.png)  
I also get this error

> * * *
> 
> AttributeError Traceback (most recent call last)  
> File ~\AppData\Local\slicer.org\Slicer 5.6.0\lib\Python\Lib\site-packages\ipywidgets\widgets\interaction.py:240, in interactive.update(self, \*args)  
> 238 value = widget.get\_interact\_value()  
> 239 self.kwargs[widget.\_kwarg] = value  
> → 240 self.result = self.f(\*\*self.kwargs)  
> 241 show\_inline\_matplotlib\_plots()  
> 242 if self.auto\_display and self.result is not None:
> 
> Cell In[7], line 15, in update(roll, pitch, yaw, cropx, cropy, cropz)  
> 11 @interact(roll=(-90.0,90.0,5), pitch=(-90.0,90.0,5), yaw=(-180.0,180.0,5), cropx=(0,140,5), cropy=(0,240,5), cropz=(0,160,5))  
> 12 def update(roll=0, pitch=-10, yaw=30, cropx=140, cropy=240, cropz=160):  
> 13 #roiNode.SetRadiusXYZ([cropx, cropy, cropz])  
> 14 roiNode.SetSizeWorld([cropx, cropy, cropz])  
> —\> 15 return slicernb.View3DDisplay(0, orientation=[roll, pitch, yaw])
> 
> File ~\AppData\Local\slicer.org\Slicer 5.6.0\slicer.org\Extensions-32390\SlicerJupyter\lib\Slicer-5.6\qt-scripted-modules\JupyterNotebooksLib\display.py:218, in View3DDisplay. **init** (self, viewID, orientation)  
> 216 view = widget.threeDView()  
> 217 if orientation is not None:  
> → 218 camera = view.interactorStyle().GetCameraNode().GetCamera()  
> 219 cameraToWorld = vtk.vtkTransform()  
> 220 cameraToWorld.RotateX(90)
> 
> AttributeError: ‘vtkmodules.vtkRenderingCore.vtkInteractorStyle3D’ object has no attribute ‘GetCameraNode’

The notebook 3 runs smoothly.  
I think it’s a version compatibility version because I couldn’t find anny other difference with the online version (that runs without error on slicer 5.0)

---

<div class="post-metadata">

### Author: ![Matteboo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/matteboo/32/66548_2.png) [@Matteboo](https://discourse.slicer.org/u/Matteboo)
#### Post date: [March 27, 2024, 1:13pm UTC](https://discourse.slicer.org/t/example-jupyter-notebook-not-compatible-with-slicer-5-6/35121/2 "2024-03-27T13:13:23Z")

</div>

After some additionnal research, I think that the issue might come from my ipywidget that’s not enabled when I select slicer as a kernel in my notebook

I found this topic from several years ago but I have the same as just\_zzzzzz

> [@Ipywidgets and SlicerJupyter](https://discourse.slicer.org/t/ipywidgets-and-slicerjupyter/11913):
>
> Hi, I downloaded the tutorial sets for SlicerJupyter and noticed that the interactive widgets were not showing up. I had to enable them using: jupyter nbextension enable --py widgetsnbextension I want to make sure that I did not miss something in the installation instructions using Option 2 (note that I did not run the additional commands for Jupyter lab): [https://github.com/Slicer/SlicerJupyter/blob/master/README.md#setup](https://github.com/Slicer/SlicerJupyter/blob/master/README.md#setup) Thanks, Vinny
