Repeated "Kernel died, restarting" forever
Asked Answered
A

12

12

When I attempt to run

$ jupyter qtconsole

The console shows up, with the message

Kernel died, restarting
________________________
Kernel died, restarting
________________________
Kernel died, restarting
________________________
Kernel died, restarting
________________________
Kernel died, restarting
________________________

Which continues.

Trying $ jupyter qtconsole --debug didn't print anything else, and neither has adding

c.Application.log_level = 0
c.Session.debug = True

into $USERHOME/.jupyter/jupyter_qtconsole_config.py

Also, I found nothing in $USERHOME/.ipython/profile_default/log/ and the other directories around there.

Nothing has changed in my configuration since last time I started up jupyter-qtconsole.

How can I at least find out what's going wrong with the kernel? Surely there is some option in Jupyter to get the kernel's STDERR output to see what exception had upset it?

Ambert answered 23/9, 2016 at 5:4 Comment(1)
I have mentioned one solution that worked for me with tensorflow 2 kernel autorestartScrumptious
S
3

Run this-

conda remove ipykernel ipython jupyter_client jupyter_core traitlets ipython_genutils

conda clean -tipsy

conda install ipykernel ipython jupyter_client jupyter_core traitlets ipython_genutils

jupyter notebook
Selectman answered 28/5, 2018 at 14:19 Comment(0)
U
2

I run

spyder --show-console

when I receive in spyder

Kernel died, restarting

I see message in console

Intel MKL FATAL ERROR: Cannot load libmkl_p4m.so or libmkl_p4.so.

It was helpfull for me

conda install nomkl numpy scipy scikit-learn numexpr
conda remove mkl mkl-service
Underthecounter answered 12/12, 2016 at 10:48 Comment(0)
B
2

Check the log. I had the same problem and my log shows no module named ipykernel_launcher. So, I just pip install ipykernel and solve the problem.

Blackburn answered 25/10, 2017 at 13:46 Comment(2)
how to check the log?Negate
In the terminal where you start your jupyter notebookBlackburn
D
2

I tried several solutions and finally i found one which really works. You just have to add an exception to your antivirus and/or firewall. I currently use Avast, so adding an exception concerning the folder where i installed Anaconda and the virtual environments solved the problem and now Spyder works as a charm.

Decontrol answered 14/3, 2018 at 22:51 Comment(0)
U
1

Encountered this problem when try to use pandas to read data in clipboard, tried many times in Spyder editor which is from the Anaconda3. I have also tried to solve the problem by updating the Spyder and other Anaconda3 packages, but failed to solve it.

Finally, without using the Anaconda3, in another PC install python 3.5.3, then pip install pandas, the error dismissed.

Unbend answered 30/11, 2016 at 9:0 Comment(0)
A
0

Given that the kernel is another process, I was able to catch the command line it was started with, using Process Explorer. The command line was

$ pythonw -m ipykernel -f "$USERHOME/AppData/Roaming/jupyter/runtime/kernel-2744.json"

Then, I just launched python and tried importing ipykernel, and got this:

$ python
Python 2.7.12 [...] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipykernel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Programs\Python2712\lib\site-packages\ipykernel\__init__.py", line 2,
 in <module>
    from .connect import *
  File "C:\Programs\Python2712\lib\site-packages\ipykernel\connect.py", line 13,
 in <module>
    from IPython.core.profiledir import ProfileDir
  File "C:\Programs\Python2712\lib\site-packages\IPython\__init__.py", line 48,
in <module>
    from .core.application import Application
  File "C:\Programs\Python2712\lib\site-packages\IPython\core\application.py", l
ine 25, in <module>
    from IPython.core import release, crashhandler
  File "C:\Programs\Python2712\lib\site-packages\IPython\core\crashhandler.py",
line 28, in <module>
    from IPython.core import ultratb
  File "C:\Programs\Python2712\lib\site-packages\IPython\core\ultratb.py", line
119, in <module>
    from IPython.core import debugger
  File "C:\Programs\Python2712\lib\site-packages\IPython\core\debugger.py", line
 36, in <module>
    from IPython.utils import PyColorize, ulinecache
  File "C:\Programs\Python2712\lib\site-packages\IPython\utils\PyColorize.py", l
ine 55, in <module>
    from IPython.utils.py3compat import PY3
  File "C:\Programs\Python2712\lib\site-packages\IPython\utils\py3compat.py", li
ne 296, in <module>
    PYPY = platform.python_implementation() == "PyPy"
AttributeError: 'module' object has no attribute 'python_implementation'
>>> exit()

And this quickly led to the problem, as described in this answer, being that the directory I was trying to start jupyter qtconsole in had a subdirectory called platform, which conflicted with the name of a module.

While this fixes this specific instance of "Kernel died, restarting", the general question still stands: how to make sure that the stacktrace, like the one above, is reported to the user of Jupyter console, instead of the kernel dying silently?

Ambert answered 23/9, 2016 at 5:4 Comment(0)
H
0

If the working directory where jupyter qtconsole is launched from contains some special characters, the "Kernel died, restarting" error may occur repeatedly.

For me, I had launched jupyter qtconsole from a working directory whose path contained spaces and ampersands (&). When I change directory to root drive (D:/ in my case) the problem goes away.

Hushaby answered 13/2, 2018 at 19:19 Comment(0)
J
0

I'm having the similar problem when I run import Tensorflow as tf. After downgrading to the Tensorflow 1.5 version, the problem was resolved.

Try uninstalling TensorFlow:

pip uninstall tensorflow

and then reinstalling 1.5:

pip install tensorflow==1.5

Junna answered 15/3, 2018 at 16:3 Comment(0)
R
0

Jupyter_client and jupyter_core releases have been made available (and contain the fix for this issue), would you mind trying the following:

1. pip install jupyter_client --upgrade - this should replace your modified jupyter_client package with release 5.3.4 and install the updated version of jupyter_core (4.6.0)

2. If you find that jupyter_core is NOT 4.6.0 - please try pip install jupyter_core --upgrade.

Check out the thread here: https://github.com/jupyter/notebook/issues/4907

Rollick answered 5/2, 2020 at 7:0 Comment(0)
T
0

I had the same problem. I deleted the content at C:\Users\youruser\AppData\Roaming\jupyter\runtime then runs again jupyter notebook. it was helpful for me.

Tedra answered 9/4, 2020 at 4:12 Comment(0)
T
0

minimize your batch_size it's working for me

i tried updating ipykernel and i updated my numpy nothing seems to work for. just minimized my batch it's working

Theotheobald answered 16/6, 2021 at 5:6 Comment(1)
please add more explanation of why it works, or the answer will likely be collapsed.Couture
T
0

In my case, Updating Numpy, reinstall jupyter, reinstall anaconda, install module with conda all are not works for me...

I just Delete CUDNN folder, and that's it...

Thermosetting answered 23/12, 2021 at 8:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.