# NameError: name 'slicer' is not defined

**URL:** <https://discourse.slicer.org/t/nameerror-name-slicer-is-not-defined/23677>\
**Category:** Support\
**Created:** [June 1, 2022, 7:36pm UTC](https://discourse.slicer.org/t/nameerror-name-slicer-is-not-defined/23677 "2022-06-01T19:36:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunshine](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@sunshine](https://discourse.slicer.org/u/sunshine)\
**Post date:** [June 1, 2022, 7:36pm UTC](https://discourse.slicer.org/t/nameerror-name-slicer-is-not-defined/23677/1 "2022-06-01T19:36:33Z")

</div>

Windows 10, Slicer 5.0.2, jupyter server 5.0

NameError: name ‘slicer’ is not defined

Please refer to this screenshot: [Capture — ImgBB](https://ibb.co/pdtfLX2)

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.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Larragueta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nicolas_larragueta/32/66218_2.png) [@Nicolas\_Larragueta](https://discourse.slicer.org/u/Nicolas_Larragueta)\
**Post date:** [April 13, 2024, 1:11pm UTC](https://discourse.slicer.org/t/nameerror-name-slicer-is-not-defined/23677/2 "2024-04-13T13:11:12Z")

</div>

could you resolve it?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 13, 2024, 3:46pm UTC](https://discourse.slicer.org/t/nameerror-name-slicer-is-not-defined/23677/3 "2024-04-13T15:46:00Z")

</div>

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