# Cannot import ipywidgets into Slicer kernel in Jupyter Notebook

**URL:** <https://discourse.slicer.org/t/cannot-import-ipywidgets-into-slicer-kernel-in-jupyter-notebook/12196>\
**Category:** Support\
**Created:** [June 24, 2020, 12:18pm UTC](https://discourse.slicer.org/t/cannot-import-ipywidgets-into-slicer-kernel-in-jupyter-notebook/12196 "2020-06-24T12:18:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ponyo2311](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ponyo2311/32/7078_2.png) [@Ponyo2311](https://discourse.slicer.org/u/Ponyo2311)\
**Post date:** [June 24, 2020, 12:18pm UTC](https://discourse.slicer.org/t/cannot-import-ipywidgets-into-slicer-kernel-in-jupyter-notebook/12196/1 "2020-06-24T12:18:30Z")

</div>

Operating system: windows10  
Slicer version: Slicer 4.11.0-2020-06-09  
Expected behavior: importation of ipywidgets module  
Actual behavior: ModuleNotFoundError

I have opened the Jupyter Notebook from my virtual environment, where the ipywidgets module (as the rest of the modules) has been installed.  
Unlike in a python kernel (where I can use ipywidgets), it seems to be not available in the Slicer kernel.

When I was installing the Slicer kernel, I followed [https://github.com/Slicer/SlicerJupyter/blob/master/README.md#setup](https://github.com/Slicer/SlicerJupyter/blob/master/README.md#setup) and double-checked with [https://ipywidgets.readthedocs.io/en/latest/user\_install.html](https://ipywidgets.readthedocs.io/en/latest/user_install.html) whether I missed anything for ipywidgets installation.

Should I install something in a different place other than my virtual environment?

---

<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:** [June 24, 2020, 3:09pm UTC](https://discourse.slicer.org/t/cannot-import-ipywidgets-into-slicer-kernel-in-jupyter-notebook/12196/2 "2020-06-24T15:09:07Z")

</div>

You need to install ipywidgets in both 3D Slicer’s Python console and in the external Python environment.

---

<div class="post-metadata">

**Author:** ![Ponyo2311](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ponyo2311/32/7078_2.png) [@Ponyo2311](https://discourse.slicer.org/u/Ponyo2311)\
**Post date:** [June 24, 2020, 3:53pm UTC](https://discourse.slicer.org/t/cannot-import-ipywidgets-into-slicer-kernel-in-jupyter-notebook/12196/3 "2020-06-24T15:53:30Z")

</div>

Yes, now it works!

Thanks a lot

---

<div class="post-metadata">

**Author:** ![LalodeAvila369](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lalodeavila369/32/67272_2.png) [@LalodeAvila369](https://discourse.slicer.org/u/LalodeAvila369)\
**Post date:** [August 22, 2023, 5:47pm UTC](https://discourse.slicer.org/t/cannot-import-ipywidgets-into-slicer-kernel-in-jupyter-notebook/12196/4 "2023-08-22T17:47:45Z")

</div>

How do you install ipywidgets in 3D Slicer’s Python console?

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [August 22, 2023, 7:47pm UTC](https://discourse.slicer.org/t/cannot-import-ipywidgets-into-slicer-kernel-in-jupyter-notebook/12196/5 "2023-08-22T19:47:58Z")

</div>

> install ipywidgets in 3D Slicer’s Python console?

For more details, see [https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#install-a-python-package](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#install-a-python-package)
