Restart the ipython kernel launched via 'ipython kernel'

I have an ipython kernel running via

ipython kernel

      

This gives me the ability to connect to this kernel from different clients (console, qtconsole or even from another machine via ssh.

The simplest case is a local connection via:

ipython qtconsole --existing kernel-xxxx.json

      

But if now I want to restart the kernel (usually via Ctrl+.

in qtconsole), I get the message:

Cannot restart a Kernel I did not start

      

This is logical, but my question is :

  • Is there a way to restart the IPython core via a connected client?

Or, if this is not possible:

  • Is there a way to initiate a kernel restart using some other command? (from the local console, not from the connected client).

I'm not looking for a way to exit the process ipython kernel

(can be done via Ctrl+\

), but just to restart the kernel without changing the kernel id.


Some information about my (I) Python environment:

python -c "import IPython; print(IPython.sys_info())"

{'commit_hash': u'2d95975',
'commit_source': 'repository',
'default_encoding': 'UTF-8',
'ipython_path': '/something/gits/ipython/IPython',
'ipython_version': '3.2.1',
'os_name': 'posix',
'platform': 'Linux-3.16.0-4-amd64-x86_64-with-debian-8.0',
'sys_executable': '/usr/bin/python',
'sys_platform': 'linux2',
'sys_version': '2.7.9 (default, Mar  1 2015, 12:57:24) \n[GCC 4.9.2]'}

      

+3


source to share


1 answer


It is currently not possible to restart the kernel from an interface that did not start it. This is a limitation that we plan to remove at some point - IPEP 12 affects these plans.



+1


source







All Articles