tkf / emacs-ipython-notebook

IPython notebook client in Emacs
tkf.github.com/emacs-ipython-notebook/
GNU General Public License v3.0
548 stars 51 forks source link

[warn] Kernel is not ready yet!, when kernel is shown as running #170

Open Anaphory opened 9 years ago

Anaphory commented 9 years ago

I often, in particular after restarting a kernel, get the message ein: [warn] Kernel is not ready yet! (or closed already.), when the kernel is shown as running in the notebooklist or a browser window. There is however no apparent way to force a ein:notebook window to re-connect to its kernel. (The obvious candidate, ein:connect-to-notebook-buffer, does not do this.

millejoh commented 9 years ago

Are you running ein as downloaded from here, or from MELPA? I only ask because this project is no longer maintained - tkf has moved on to other things apparently. ein is now maintained by me over at https://github.com/millejoh/emacs-ipython-notebook.

With that said, I get this problem at times as well and has proven difficult to diagnose and debug. Communication with the ipython server is done asynchronously, and it looks like something is getting out of sync. One workaround is to kill the notebook buffer and then reopen the notebook from the notebooklist buffer. Maybe I need to add a ein:reconnect-to-kernel command...

Anaphory commented 9 years ago

Ehm. I think I installed the version from MELPA, but I can check. I may have been confused by something, but I think I tried killing and reconnecting, and still sometime got that error.

Something like ein:reconnect-to-kernel was what I expected to exist, and was surprised to not find it.

millejoh commented 9 years ago

If you are running the version from MELPA, or from github, then you should be seeing soon a commit that tries to address this. Turns out the code for restarting the kernel had a bug - that should work correctly now. Also added a command ein:notebook-reconnect-kernel which closes and reopens the websocket connection to a running kernel.