Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter kernel dies on Ubuntu

Last night I downloaded Anaconda and installed Jupyter in line with its instructions under Ubuntu. I am looking to replicate some fairly straightforward code written in Python that has run in a normal Python 3.x environment and has ALSO run in the trial version of Jupyter, so I guess that we are looking at a system issue.

On installation I open a Python 3 notebook initially it says "Kernel Starting please wait.." It then says that it is ready and then in a couple of seconds it says that the kernel is dead and unable to re-start. In fact it comes back with the specific message "Dead kernel". This is BEFORE I even enter any code of any sort.

I have got everything installed correctly - I think!

I am running 16.04 LTS. Python is 3.7

I have checked other similar posts but the solutions offered don't fit in this case. Is it perhaps something deeper.

Thanks for any help you can offer.

Output from Jupyter notebook --debug follows:


peter@xxxx:~$ jupyter notebook --debug
[D 19:45:46.147 NotebookApp] Searching ['/home/peter', '/home/peter/.jupyter', '/home/peter/anaconda3/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 19:45:46.149 NotebookApp] Looking for jupyter_config in /etc/jupyter
[D 19:45:46.149 NotebookApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 19:45:46.150 NotebookApp] Looking for jupyter_config in /home/peter/anaconda3/etc/jupyter
[D 19:45:46.150 NotebookApp] Looking for jupyter_config in /home/peter/.jupyter
[D 19:45:46.150 NotebookApp] Looking for jupyter_config in /home/peter
[D 19:45:46.152 NotebookApp] Looking for jupyter_notebook_config in /etc/jupyter
[D 19:45:46.152 NotebookApp] Looking for jupyter_notebook_config in /usr/local/etc/jupyter
[D 19:45:46.152 NotebookApp] Looking for jupyter_notebook_config in /home/peter/anaconda3/etc/jupyter
[D 19:45:46.153 NotebookApp] Looking for jupyter_notebook_config in /home/peter/.jupyter
[D 19:45:46.153 NotebookApp] Looking for jupyter_notebook_config in /home/peter
[I 19:45:46.644 NotebookApp] Serving notebooks from local directory: /home/peter
[I 19:45:46.644 NotebookApp] 0 active kernels 
[I 19:45:46.644 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=aabe7a1a36a3b0bbeac24f68420aca3996fc05257b13eb85
[I 19:45:46.644 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 19:45:46.651 NotebookApp] 

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=aabe7a1a36a3b0bbeac24f68420aca3996fc05257b13eb85
[I 19:45:46.882 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1
[D 19:45:46.885 NotebookApp] Using contents: services/contents
[D 19:45:46.982 NotebookApp] Path base/images/favicon.ico served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/base/images/favicon.ico
[D 19:45:46.982 NotebookApp] Path components/jquery-ui/themes/smoothness/jquery-ui.min.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/jquery-ui/themes/smoothness/jquery-ui.min.css
[D 19:45:46.983 NotebookApp] Path components/jquery-typeahead/dist/jquery.typeahead.min.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/jquery-typeahead/dist/jquery.typeahead.min.css
[D 19:45:46.983 NotebookApp] Path style/style.min.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/style/style.min.css
[D 19:45:46.985 NotebookApp] Path components/es6-promise/promise.min.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/es6-promise/promise.min.js
[D 19:45:46.985 NotebookApp] Path components/requirejs/require.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/requirejs/require.js
[D 19:45:46.986 NotebookApp] Path base/images/logo.png served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/base/images/logo.png
[D 19:45:46.987 NotebookApp] Path tree/js/main.min.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/tree/js/main.min.js
[D 19:45:46.993 NotebookApp] 200 GET /tree?token=b921788f87fa7cc313f98e9e4e37a23f005ad3f2e727cc3f (127.0.0.1) 112.57ms
[D 19:45:47.120 NotebookApp] Path custom.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/custom/custom.css
[D 19:45:47.122 NotebookApp] 304 GET /custom/custom.css (127.0.0.1) 3.34ms
[D 19:45:47.499 NotebookApp] Path services/contents.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/services/contents.js
[D 19:45:47.501 NotebookApp] 200 GET /static/services/contents.js?v=20170427194546 (127.0.0.1) 5.54ms
[D 19:45:47.510 NotebookApp] Path custom.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/custom/custom.js
[D 19:45:47.512 NotebookApp] 200 GET /custom/custom.js?v=20170427194546 (127.0.0.1) 3.43ms
[D 19:45:47.585 NotebookApp] 200 GET /api/config/tree?_=1493318747367 (127.0.0.1) 7.78ms
[D 19:45:47.591 NotebookApp] 200 GET /api/config/common?_=1493318747368 (127.0.0.1) 4.54ms
[D 19:45:47.599 NotebookApp] 200 GET /api/terminals?_=1493318747369 (127.0.0.1) 1.57ms
[D 19:45:47.606 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:47.607 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:47.614 NotebookApp] 304 GET /api/kernelspecs (127.0.0.1) 10.39ms
[D 19:45:47.618 NotebookApp] 200 GET /api/terminals?_=1493318747371 (127.0.0.1) 1.68ms
[D 19:45:47.621 NotebookApp] 200 GET /api/sessions?_=1493318747370 (127.0.0.1) 2.22ms
[D 19:45:47.714 NotebookApp] 200 GET /api/contents?type=directory&_=1493318747372 (127.0.0.1) 40.84ms
[I 19:45:53.598 NotebookApp] Creating new notebook in 
[D 19:45:53.604 NotebookApp] Saving /home/peter/Untitled5.ipynb
[D 19:45:53.939 NotebookApp] 201 POST /api/contents (127.0.0.1) 343.75ms
[D 19:45:53.948 NotebookApp] Using contents: services/contents
[D 19:45:54.008 NotebookApp] Path components/bootstrap-tour/build/css/bootstrap-tour.min.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/bootstrap-tour/build/css/bootstrap-tour.min.css
[D 19:45:54.008 NotebookApp] Path components/codemirror/lib/codemirror.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/codemirror/lib/codemirror.css
[D 19:45:54.009 NotebookApp] Path notebook/css/override.css served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/notebook/css/override.css
[D 19:45:54.010 NotebookApp] Path components/text-encoding/lib/encoding.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/text-encoding/lib/encoding.js
[D 19:45:54.010 NotebookApp] Path notebook/js/main.min.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/notebook/js/main.min.js
[D 19:45:54.016 NotebookApp] 200 GET /notebooks/Untitled5.ipynb?kernel_name=python3 (127.0.0.1) 69.16ms
[D 19:45:54.063 NotebookApp] Path components/MathJax/MathJax.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/MathJax.js
[D 19:45:54.064 NotebookApp] 304 GET /static/components/MathJax/MathJax.js?config=TeX-AMS_HTML-full,Safe&delayStartupUntil=configured (127.0.0.1) 2.21ms
[D 19:45:54.067 NotebookApp] 304 GET /custom/custom.css (127.0.0.1) 1.47ms
[D 19:45:54.220 NotebookApp] Path components/MathJax/config/TeX-AMS_HTML-full.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/config/TeX-AMS_HTML-full.js
[D 19:45:54.221 NotebookApp] 304 GET /static/components/MathJax/config/TeX-AMS_HTML-full.js?rev=2.6.0 (127.0.0.1) 2.67ms
[D 19:45:54.635 NotebookApp] 304 GET /custom/custom.js?v=20170427194546 (127.0.0.1) 1.61ms
[D 19:45:54.711 NotebookApp] Path components/MathJax/config/Safe.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/config/Safe.js
[D 19:45:54.713 NotebookApp] 304 GET /static/components/MathJax/config/Safe.js?rev=2.6.0 (127.0.0.1) 2.84ms
[D 19:45:54.788 NotebookApp] 200 GET /api/config/notebook?_=1493318754418 (127.0.0.1) 8.55ms
[D 19:45:54.795 NotebookApp] 200 GET /api/config/common?_=1493318754419 (127.0.0.1) 5.98ms
[D 19:45:54.918 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:54.918 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:54.920 NotebookApp] 304 GET /api/kernelspecs (127.0.0.1) 3.39ms
[D 19:45:55.147 NotebookApp] 200 GET /api/contents/Untitled5.ipynb?type=notebook&_=1493318754420 (127.0.0.1) 180.31ms
[D 19:45:55.150 NotebookApp] Path components/MathJax/extensions/Safe.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/extensions/Safe.js
[D 19:45:55.151 NotebookApp] 304 GET /static/components/MathJax/extensions/Safe.js?rev=2.6.0 (127.0.0.1) 1.94ms
[D 19:45:55.153 NotebookApp] Path jupyter-js-widgets/extension.js served from /home/peter/anaconda3/share/jupyter/nbextensions/jupyter-js-widgets/extension.js
[D 19:45:55.158 NotebookApp] 200 GET /nbextensions/jupyter-js-widgets/extension.js?v=20170427194546 (127.0.0.1) 5.83ms
[D 19:45:55.160 NotebookApp] Path components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js served from /home/peter/anaconda3/lib/python3.6/site-packages/notebook/static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js
[D 19:45:55.161 NotebookApp] 304 GET /static/components/MathJax/jax/output/HTML-CSS/fonts/STIX-Web/fontdata.js?rev=2.6.0 (127.0.0.1) 2.33ms
[D 19:45:55.372 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:45:55.374 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:45:55.387 NotebookApp] Connecting to: tcp://127.0.0.1:39311
[I 19:45:55.389 NotebookApp] Kernel started: de446353-af9d-4b59-bfc1-a8cdb4572ac4
[D 19:45:55.390 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/home/peter'}
[D 19:45:55.393 NotebookApp] 201 POST /api/sessions (127.0.0.1) 44.08ms
[D 19:45:55.398 NotebookApp] 200 GET /api/contents/Untitled5.ipynb/checkpoints?_=1493318754421 (127.0.0.1) 3.89ms
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[D 19:45:55.554 NotebookApp] Initializing websocket connection /api/kernels/de446353-af9d-4b59-bfc1-a8cdb4572ac4/channels
[D 19:45:55.564 NotebookApp] Requesting kernel info from de446353-af9d-4b59-bfc1-a8cdb4572ac4
[D 19:45:55.565 NotebookApp] Connecting to: tcp://127.0.0.1:49900
[I 19:45:58.388 NotebookApp] KernelRestarter: restarting kernel (1/5)
[D 19:45:58.390 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:45:58.397 NotebookApp] Connecting to: tcp://127.0.0.1:39311
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:01.397 NotebookApp] KernelRestarter: restarting kernel (2/5)
[D 19:46:01.399 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:46:01.407 NotebookApp] Connecting to: tcp://127.0.0.1:39311
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:04.409 NotebookApp] KernelRestarter: restarting kernel (3/5)
[D 19:46:04.411 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:46:04.421 NotebookApp] Connecting to: tcp://127.0.0.1:39311
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[W 19:46:05.568 NotebookApp] Timeout waiting for kernel_info reply from de446353-af9d-4b59-bfc1-a8cdb4572ac4
[D 19:46:05.571 NotebookApp] Opening websocket /api/kernels/de446353-af9d-4b59-bfc1-a8cdb4572ac4/channels
[D 19:46:05.571 NotebookApp] Connecting to: tcp://127.0.0.1:49900
[D 19:46:05.572 NotebookApp] Connecting to: tcp://127.0.0.1:52325
[D 19:46:05.573 NotebookApp] Connecting to: tcp://127.0.0.1:38447
[I 19:46:07.423 NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel de446353-af9d-4b59-bfc1-a8cdb4572ac4 restarted
[D 19:46:07.426 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-de446353-af9d-4b59-bfc1-a8cdb4572ac4.json']
[D 19:46:07.435 NotebookApp] Connecting to: tcp://127.0.0.1:39311
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[W 19:46:10.438 NotebookApp] KernelRestarter: restart failed
[W 19:46:10.438 NotebookApp] Kernel de446353-af9d-4b59-bfc1-a8cdb4572ac4 died, removing from map.
ERROR:root:kernel de446353-af9d-4b59-bfc1-a8cdb4572ac4 restarted failed!
[D 19:46:10.476 NotebookApp] Websocket closed de446353-af9d-4b59-bfc1-a8cdb4572ac4:3D6BAC1FF1694B3B8331E3A303569344
[W 19:46:10.482 NotebookApp] Kernel deleted before session
[W 19:46:10.483 NotebookApp] 410 DELETE /api/sessions/9710cac7-54ef-461d-a3b4-acbfcf981ce8 (127.0.0.1) 3.52ms referer=http://localhost:8888/notebooks/Untitled5.ipynb?kernel_name=python3
[W 19:46:16.663 NotebookApp] Session not found: session_id='9710cac7-54ef-461d-a3b4-acbfcf981ce8'
[W 19:46:16.664 NotebookApp] 404 DELETE /api/sessions/9710cac7-54ef-461d-a3b4-acbfcf981ce8 (127.0.0.1) 2.51ms referer=http://localhost:8888/notebooks/Untitled5.ipynb?kernel_name=python3
[D 19:46:16.712 NotebookApp] Found kernel python3 in /usr/local/share/jupyter/kernels
[D 19:46:16.714 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:16.723 NotebookApp] Connecting to: tcp://127.0.0.1:55773
[I 19:46:16.725 NotebookApp] Kernel started: fb22aad0-0e7c-42c5-b026-1e25ecf89439
[D 19:46:16.725 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/home/peter'}
[D 19:46:16.727 NotebookApp] 201 POST /api/sessions (127.0.0.1) 23.69ms
[D 19:46:16.766 NotebookApp] Initializing websocket connection /api/kernels/fb22aad0-0e7c-42c5-b026-1e25ecf89439/channels
[D 19:46:16.771 NotebookApp] Requesting kernel info from fb22aad0-0e7c-42c5-b026-1e25ecf89439
[D 19:46:16.771 NotebookApp] Connecting to: tcp://127.0.0.1:36903
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:19.726 NotebookApp] KernelRestarter: restarting kernel (1/5)
[D 19:46:19.728 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:19.739 NotebookApp] Connecting to: tcp://127.0.0.1:55773
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:22.742 NotebookApp] KernelRestarter: restarting kernel (2/5)
[D 19:46:22.744 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:22.753 NotebookApp] Connecting to: tcp://127.0.0.1:55773
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[I 19:46:25.756 NotebookApp] KernelRestarter: restarting kernel (3/5)
[D 19:46:25.758 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:25.767 NotebookApp] Connecting to: tcp://127.0.0.1:55773
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[W 19:46:26.773 NotebookApp] Timeout waiting for kernel_info reply from fb22aad0-0e7c-42c5-b026-1e25ecf89439
[D 19:46:26.775 NotebookApp] Opening websocket /api/kernels/fb22aad0-0e7c-42c5-b026-1e25ecf89439/channels
[D 19:46:26.776 NotebookApp] Connecting to: tcp://127.0.0.1:36903
[D 19:46:26.777 NotebookApp] Connecting to: tcp://127.0.0.1:53792
[D 19:46:26.778 NotebookApp] Connecting to: tcp://127.0.0.1:44277
[I 19:46:28.769 NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel fb22aad0-0e7c-42c5-b026-1e25ecf89439 restarted
[D 19:46:28.772 NotebookApp] Starting kernel: ['python', '-m', 'ipykernel_launcher', '-f', '/run/user/1000/jupyter/kernel-fb22aad0-0e7c-42c5-b026-1e25ecf89439.json']
[D 19:46:28.781 NotebookApp] Connecting to: tcp://127.0.0.1:55773
/home/peter/anaconda3/bin/python: No module named ipykernel_launcher
[W 19:46:31.784 NotebookApp] KernelRestarter: restart failed
[W 19:46:31.785 NotebookApp] Kernel fb22aad0-0e7c-42c5-b026-1e25ecf89439 died, removing from map.
ERROR:root:kernel fb22aad0-0e7c-42c5-b026-1e25ecf89439 restarted failed!
[D 19:46:31.843 NotebookApp] Websocket closed fb22aad0-0e7c-42c5-b026-1e25ecf89439:3D6BAC1FF1694B3B8331E3A303569344
[W 19:46:31.849 NotebookApp] Kernel deleted before session
[W 19:46:31.851 NotebookApp] 410 DELETE /api/sessions/f6a1b60a-6b90-4fd3-8166-b3de0d35cf74 (127.0.0.1) 4.29ms referer=http://localhost:8888/notebooks/Untitled5.ipynb?kernel_name=python3
^C[I 19:46:51.302 NotebookApp] interrupted
Serving notebooks from local directory: /home/peter
0 active kernels 
The Jupyter Notebook is running at: http://localhost:8888/?token=aabe7a1a36a3b0bbeac24f68420aca3996fc05257b13eb85
Shutdown this notebook server (y/[n])? yNo answer for 5s: resuming operation...
y
^C[I 19:47:12.400 NotebookApp] interrupted
Serving notebooks from local directory: /home/peter
0 active kernels 
The Jupyter Notebook is running at: http://localhost:8888/?token=aabe7a1a36a3b0bbeac24f68420aca3996fc05257b13eb85
Shutdown this notebook server (y/[n])? y
[C 19:47:14.911 NotebookApp] Shutdown confirmed
[I 19:47:14.912 NotebookApp] Shutting down kernels
peter@xxxx:~$ 
like image 348
PeterDz Avatar asked Apr 27 '17 18:04

PeterDz


People also ask

How do I fix the kernel error in Jupyter Notebook?

If you don't know what that means, and don't want to find out, just (re)install Anaconda with the default settings, and it should set up PATH correctly. If Jupyter gives an error that it can't find notebook , check with pip or conda that the notebook package is installed. Try running jupyter-notebook (with a hyphen).

How do you reset a kernel Jupyter?

You can run the whole notebook in a single step by clicking on the menu Cell -> Run All. To restart the kernel (i.e. the computational engine), click on the menu Kernel -> Restart.

What is Ipykernel in Jupyter Notebook?

The IPython kernel is the Python execution backend for Jupyter. The Jupyter Notebook and other frontends automatically ensure that the IPython kernel is available. However, if you want to use a kernel with a different version of Python, or in a virtualenv or conda environment, you'll need to install that manually.


1 Answers

just had the same problem on Ubuntu 14.04

got it solved by upgrading the ipykernel

sudo pip install --upgrade ipykernel
like image 164
Yonti Avatar answered Sep 30 '22 03:09

Yonti