NameError: name 'slicer' is not defined

Windows 10, Slicer 5.0.2, jupyter server 5.0

NameError: name ‘slicer’ is not defined

Please refer to this screenshot: Capture — ImgBB

In the cmd history, we can see that the scene file is loaded successfully, however, I always failed to call the slicer.util.getNode command.

This code works well in version Slicer 4.13, and the error appears in version 5.02.

could you resolve it?

You can add import slicer to the line before to avoid this issue.

1 Like