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?