Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not stop "ipython kernel" on windows #2049

Closed
jstenar opened this issue Jun 28, 2012 · 13 comments · Fixed by #3753
Closed

Can not stop "ipython kernel" on windows #2049

jstenar opened this issue Jun 28, 2012 · 13 comments · Fixed by #3753
Labels
Milestone

Comments

@jstenar
Copy link
Member

jstenar commented Jun 28, 2012

when running the "ipython kernel" command on windows I can not stop the kernel process. Ctrl-c does not stop the process like it does when using "ipython notebook". I have to kill the process manually using the process explorer.

@minrk
Copy link
Member

minrk commented Jun 28, 2012

Not windows specific, and also not so much a bug as an annoying feature. If we allowed sigint to terminate a kernel, then interrupting it from the notebook or qtconsole would occasionally appear as a crash.

@joonro
Copy link
Contributor

joonro commented Dec 13, 2012

I am not sure if this is the same problem I have. I started a kernel with IPython.embed_kernel(), and I cannot kill it. I'm using linux and ctrl + c does not work.

@minrk
Copy link
Member

minrk commented Jan 20, 2013

^C should not terminate the process, because ^C must be interpreted as a regular sigint and raise KeyboardInterrupt in user code. We don't want ^C to kill the kernel, because then if a user tries to interrupt their own code, the kernel will die. We used to allow ^C to kill the kernel while user code was not running, but this still allowed accidental kernel shutdown if you tried to interrupt your own code, but ended up sending the signal after your code finished. The only sensible answer is for kernels to not be killed by ^C.

We could, however, change the ipython kernel entry point to, instead of launching the kernel directly, start a minimal KernelManager, which in turn starts the actual Kernel. If we did this, then you could interrupt the KernelManager directly with ^C, which would in turn cleanup the kernel.

@idbrii
Copy link

idbrii commented Feb 17, 2013

Is the only way to kill ipython kernel to send it a sigterm?

@minrk
Copy link
Member

minrk commented Feb 17, 2013

@pydave or ask it to shutdown from a frontend.

@ivanov
Copy link
Member

ivanov commented Jul 24, 2013

arg! i just spent a half hour trying to figure out where i should make some changes to make this work... :\

@lithp
Copy link

lithp commented Nov 20, 2013

@minrk I've tried my best to google but can't seem to find it. How do you ask it to shutdown from a frontend?

@minrk
Copy link
Member

minrk commented Nov 20, 2013

If it's a terminal client, you can type exit. Or you can connect a KernelClient object, and call client.shutdown()

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@franco2ke
Copy link

@minrk thanks for the explanation. However now that you have shown why ctrl-c does not work, how do I stop the script?

@franco2ke
Copy link

Ok! My bad. I just found out because I had set 'debug = True' it was reloading my script continuously, that's why I wasn't able to stop it. Ctrl-c worked for me, on the regular console

@cerodell
Copy link

cerodell commented Sep 6, 2019

I'm having an issue connecting to an existing kernel on a remote server while using spyder on my local machine.

I am running spyder 3.3.6, I have installed miniconda and spyder-kernels on the remote server.

I launch python -m spyder_kernels.console on the remote server

Then on my local machine running spyder, I go the "gear" tab in the iPython console and click "connect to an existing kernel".

I check the "This is a remote kernel (VIA SSH)"
Type in hostname and password...then nothing..... won't connect.

Where am I going wrong?

Thank you in advance for your help!!!!!!!

@Ambuj-Choudha

This comment was marked as off-topic.

@MrMino
Copy link
Member

MrMino commented May 25, 2022

@Ambuj-Choudha this is a thread from 10 years ago, and it's unrelated to your issue. Please create a new issue in appropriate tracker from Jupyter org or in ipykernel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants