4

I have an ipython kernel started via

ipython kernel

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

The simplest case is to connect locally via:

ipython qtconsole --existing kernel-xxxx.json

But if I now 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 an IPython kernel via a connected client?

Or, if this is not possible:

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

I'm not looking for a way to quit the ipython kernel process (can be done via Ctrl+\), but just to restart the kernel without changing the kernel id.


Some info 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]'}
4
  • I don't think there's a way to do that at present. It's a limitation we plan to remove at some point. Commented Aug 5, 2015 at 17:00
  • Ok, thank you for this clarification. Do you know if there is a github issue on this topic? I did not find anything special, but maybe you have a better overview if you are aware of this limitation. Commented Aug 6, 2015 at 6:46
  • It's touched on in IPEP 12. Commented Aug 6, 2015 at 18:45
  • Thanks. I think if you combine both comments into an answer I could accept it, as it clearly answers my question and others might stumble upon the same thing when they try the ipython kernel. Commented Aug 9, 2015 at 7:21

1 Answer 1

2

It's not currently possible to restart a kernel from a frontend that didn't start it. That's a limitation we plan to remove at some point - IPEP 12 touches on those plans.

Sign up to request clarification or add additional context in comments.

1 Comment

How this going?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.