# How to start Slicer Jupyter kernel?

**URL:** <https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855>\
**Category:** Support\
**Tags:** jupyter\
**Created:** [August 21, 2018, 11:01am UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855 "2018-08-21T11:01:54Z")\
**Posts on this page:** 12\
**Page:** 2

<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:** [November 26, 2018, 11:57pm UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/21 "2018-11-26T23:57:17Z")

</div>

What operating system do you use? What Python distribution do you use?

> [@darekdev](#):
>
> when running the jupyter kernel Slicer exit abnormally

What do you mean by “running the Jupyter kernel”? What do you do exactly (what application you started or what command entered)?

> I downloaded stable Slicer then installed SlicerJupyter(it didn’t appear in modules then manually copy libs).

What did you copy? Where?

---

<div class="post-metadata">

**Author:** ![darekdev](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@darekdev](https://discourse.slicer.org/u/darekdev)\
**Post date:** [November 27, 2018, 7:02am UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/22 "2018-11-27T07:02:39Z")

</div>

Linux. Python Environment manages by Miniconda.

Start jupyter and then run notebook (kernel is Slicer 4.10).

Because when I installed extension SlicerJupyter it doesn’t appear in modules menu. Additionaly I checked in python interpreter slicer.modules. Then I manually copy files from ~/.config/NA-MIC/Extension-27501/SlicerJupyter/lib and share to Slicer-4.10.0-linux-amd64/lib and share. Then JupyterKernel show in Slicer.

I checked pyzmq with no change.  
I don’t know why Slicer doesn’t load correctly module, because I see in Settings/Modules path to ~/.config/NA-MIC/Extensions-27501/SlicerJupyter/lib/Slicer-4.10/qt-loadable-modules/ and exist in Extension Manager.

---

<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:** [November 27, 2018, 7:22am UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/23 "2018-11-27T07:22:09Z")

</div>

@jcfr Could you try installing SlicerJupyter on your Linux computer and check if the modules is loaded?

@ihnorton created a docker image that works well on [binder](https://mybinder.org/v2/gh/slicer/SlicerNotebooks/master), but that’s for Slicer-4.9, so it does not directly prove that it should work with Slicer-4.10, too.

---

<div class="post-metadata">

**Author:** ![darekdev](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@darekdev](https://discourse.slicer.org/u/darekdev)\
**Post date:** [November 27, 2018, 8:01am UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/24 "2018-11-27T08:01:13Z")

</div>

Maby I should check slicer 4.9 but I don’t know what revision, because some crash when I try open Extension Manager.

---

<div class="post-metadata">

**Author:** ![darekdev](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@darekdev](https://discourse.slicer.org/u/darekdev)\
**Post date:** [November 27, 2018, 12:01pm UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/25 "2018-11-27T12:01:01Z")

</div>

Working… but. Firstly I removed Slicer-4.10.0 and install and follow installation from this repo:  
[https://github.com/ihnorton/dockerfiles/tree/master/slicer2binder](https://github.com/ihnorton/dockerfiles/tree/master/slicer2binder) and then I saw some interesting line here [https://github.com/ihnorton/dockerfiles/blob/master/slicer2binder/install.sh](https://github.com/ihnorton/dockerfiles/blob/master/slicer2binder/install.sh):

> # TODO HACK  
> export LD\_LIBRARY\_PATH=$HOME/.config/NA-MIC/Extensions-27480/SlicerJupyter/lib64/

And everything works but one CPU core has 100% usage.

Then I try same guidelines with Slicer-4.10 but Jupyter can’t start Slicer with this export:

> export LD\_LIBRARY\_PATH=$HOME/.config/NA-MIC/Extensions-27501/SlicerJupyter/lib64/

but working with this:

> export LD\_LIBRARY\_PATH=$HOME/.config/NA-MIC/Extensions-27480/SlicerJupyter/lib64/

It is curious, because(static/dynamic linking?):

 ![curious](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/3/1347233a6a8a73071f875733db06ea2bb64bfdd0.png)

Slicer 4.10(or 4.9) working with SlicerJupyter when is set:

> export LD\_LIBRARY\_PATH=$HOME/.config/NA-MIC/Extensions-27480/SlicerJupyter/lib64/

---

<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:** [November 27, 2018, 2:03pm UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/26 "2018-11-27T14:03:31Z")

</div>

Thanks a lot @darekdev , these are very helpful! @jcfr when you have some time please have a look at this. I think for you it should be very easy to fix this.

Reported 100% CPU use should not cause any problem or affect processing speed, it just polls the jupyter connection very frequently when the application is idle. I’ve implemented a fix for Windows but wanted to get confirmation from users that it happens on other platforms, too, before enabling it everywhere. I’ll now enable it for all platforms.

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [November 27, 2018, 2:12pm UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/27 "2018-11-27T14:12:28Z")

</div>

> [@lassoan](#):
>
> created a docker image that works well on [binder](https://mybinder.org/v2/gh/slicer/SlicerNotebooks/master), but that’s for Slicer-4.9, so it does not directly prove that it should work with Slicer-4.10, too.

I built a SlicerJupyter extension bundle (w/ Slicer nightly image) separate from the nightly package, due to the missing libuuid on the build machine at the time. That is fixed now, but I haven’t tested SlicerJupyter on a real linux machine. I think the export is needed because the fixup step doesn’t work correctly for libxeus or one of the other secondary requirements. I will update the docker image soon and have a look if Jc doesn’t fix it first.

---

<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:** [November 28, 2018, 8:23am UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/28 "2018-11-28T08:23:53Z")

</div>

> [@lassoan](#):
>
> when you have some time please have a look at this. I think for you it should be very easy to fix this.

This is now fixed in

> <https://github.com/Slicer/SlicerJupyter/commit/18f1346d735126196cda52ee015c864b88f7b962>
>
> See https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/25

---

<div class="post-metadata">

**Author:** ![darekdev](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@darekdev](https://discourse.slicer.org/u/darekdev)\
**Post date:** [November 30, 2018, 10:55am UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/29 "2018-11-30T10:55:55Z")

</div>

In reference to the use of CPU.  
I test this module and there is no more 100% CPU usage.

---

<div class="post-metadata">

**Author:** ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)\
**Post date:** [July 11, 2019, 1:37pm UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/30 "2019-07-11T13:37:51Z")

</div>

Dear andras,  
I installed a new version of slicer 4.11.0 and I tried to install the jupyter kernel but it gives me error.

Kernelspec install error output: “Traceback (most recent call last):\r\n File "C:\Users\22374464\AppData\Local\Continuum\anaconda3\Scripts\jupyter-kernelspec-script.py", line 6, in \r\n from jupyter\_client.kernelspecapp import KernelSpecApp\r\n File "C:\Users\22374464\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter\_client\ **init**.py", line 4, in \r\n from .connect import \*\r\n File "C:\Users\22374464\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter\_client\connect.py", line 23, in \r\n import zmq\r\n File "C:\Users\22374464\AppData\Local\Continuum\anaconda3\lib\site-packages\zmq\ **init**.py", line 47, in \r\n from zmq import backend\r\n File "C:\Users\22374464\AppData\Local\Continuum\anaconda3\lib\site-packages\zmq\backend\ **init**.py", line 40, in \r\n reraise(\*exc\_info)\r\n File "C:\Users\22374464\AppData\Local\Continuum\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise\r\n raise value\r\n File "C:\Users\22374464\AppData\Local\Continuum\anaconda3\lib\site-packages\zmq\backend\ **init**.py", line 27, in \r\n \_ns = select\_backend(first)\r\n File "C:\Users\22374464\AppData\Local\Continuum\anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select\_backend\r\n mod = **import** (name, fromlist=public\_api)\r\n File "C:\Users\22374464\AppData\Local\Continuum\anaconda3\lib\site-packages\zmq\backend\cython\ **init**.py", line 6, in \r\n from . import (constants, error, message, context,\r\nImportError: DLL load failed: The specified module could not be found.\r\n”  
bool \_\_cdecl qSlicerJupyterKernelModule::installSlicerKernel(class QString) failed: process “C:/Users/22374464/AppData/Local/Continuum/anaconda3/Scripts/jupyter-kernelspec” returned with exit code 1

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/d/adf40c3c58c6159dc26986ffa8012928a05a368c.png)

---

<div class="post-metadata">

**Author:** ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)\
**Post date:** [July 11, 2019, 2:12pm UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/31 "2019-07-11T14:12:48Z")

</div>

Dear Andras,  
The error is fixed. I am using anaconda.  
Did what was written on

> <https://github.com/Slicer/SlicerJupyter/blob/master/README.md>

pip uninstall pyzmq  
and then  
pip install pyzmq

thanks a lot.

can i use the web version of jupyter?

---

<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:** [July 11, 2019, 2:21pm UTC](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855/32 "2019-07-11T14:21:31Z")

</div>

> [@Saima](#):
>
> can i use the web version of jupyter?

It is indeed possible to open Slicer notebooks on the cloud using binder. See [GitHub - Slicer/SlicerJupyter: Extension for 3D Slicer that allows the application to be used from Jupyter notebook](https://github.com/Slicer/SlicerJupyter#option-1-run-using-binder)

[Previous page](https://discourse.slicer.org/t/how-to-start-slicer-jupyter-kernel/3855.md?page=1)
