millejoh / emacs-ipython-notebook

Jupyter notebook client in Emacs
http://millejoh.github.io/emacs-ipython-notebook/
GNU General Public License v3.0
1.47k stars 122 forks source link

When using alternative kernels, cell numbers do not increment #317

Closed cunningjames closed 6 years ago

cunningjames commented 6 years ago

Hello:

Currently using EIN 20180612.432 (from melpa), Emacs 26.1, and Jupyter 4.4.0 on OS X 10.12.6, though I've had the same issue on Windows 10 with (probably) different versions of the above.

When using EIN with any Kernel besides IPython, everything seems to work except that cell numbers don't increment: each additional cell has number 1. Tested with latest IRkernel and IJulia.

Thanks for the software! The fact that other Kernels work at all is great.

Edit: Noticed you wanted a format for bug reports:

Check list

Description of the problem you have

When using alternative kernels (anything other than IPython, tested with latest IRkernel and IJulia), cell numbers do not increment. Everything else appears to work.

Steps to reproduce the problem

  1. Start EIN
  2. Run Jupyter server
  3. Select alternative kernel / language when creating new notebook
  4. Execute more than one cell

Expected output

Each additional cell executed should have a cell number one greater than the last

Your EIN configuration (in .emacs.d/init.el or somewhere else)

(use-package ein :ensure t :pin melpa)

Your IPython configuration

  1. What is your IPython version? (run ipython --version): 6.4.0
  2. How do you start IPython? (e.g., ipython notebook --port 9999): ein:jupyter-server-start from Emacs; jupyter notebook from terminal
  3. What is your IPython notebook port number or URL?: port 8888

Additional information (if any)

Using OS X, but the issue occurs on Windows.

System info:

("EIN system info" :emacs-version "GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511))
 of 2018-05-30" :emacs-bzr-version nil :window-system ns :emacs-variant nil :os (:uname "Darwin CINMAC11543.local 16.7.0 Darwin Kernel Version 16.7.0: Fri Apr 27 17:59:46 PDT 2018; root:xnu-3789.73.13~1/RELEASE_X86_64 x86_64
" :lsb-release nil) :image-types (png gif tiff jpeg xpm xbm pbm) :image-types-available (png gif tiff jpeg xpm xbm pbm) :request (:backend curl) :ein (:version "0.14.2" :source-dir "/Users/j260381/.emacs.d/elpa/ein-20180612.432/") :lib ((:name "websocket" :path "~/.emacs.d/elpa/websocket-20180422.1716/websocket.elc" :featurep t :version-var websocket-version :version "1.9") (:name "request" :path "~/.emacs.d/elpa/request-20170131.1747/request.elc" :featurep t :version-var request-version :version "0.3.0") (:name "auto-complete" :path "~/.emacs.d/elpa/auto-complete-20170124.1845/auto-complete.elc" :featurep t :version-var nil :version nil) (:name "auto-complete" :path "~/.emacs.d/elpa/auto-complete-20170124.1845/auto-complete.elc" :featurep t :version-var nil :version nil) (:name "popup" :path "~/.emacs.d/elpa/popup-20160709.729/popup.elc" :featurep t :version-var popup-version :version "0.5.3") (:name "python" :path "/Applications/Emacs.app/Contents/Resources/lisp/progmodes/python.elc" :featurep t :version-var nil :version nil) (:name "python-mode" :path "~/.emacs.d/elpa/python-mode-20180319.344/python-mode.elc" :featurep t :version-var nil :version nil) (:name "markdown-mode" :path "~/.emacs.d/elpa/markdown-mode-20180607.913/markdown-mode.elc" :featurep t :version-var markdown-mode-version :version "2.4-dev")))
millejoh commented 6 years ago

This is indeed a strange one. As far as I can tell ein is doing what it should be when sending the execute request to the IRKernel, but the execution count always comes back the same. Clearly ein is doing something wrong since everything works fine in the web client, but your guess as to what exactly is as good as mine.

I'm hoping the experts over at IRKernel can help; I have opened an issue, IRkernel/IRkernel#576. I hope someone can direct me in the right direction on this.

takluyver commented 6 years ago

From the IRkernel issue, it looks like EIN is sending "show-history" instead of "store_history". I guess IPython assumes the field is True if it's missing, and IRkernel assumes it's False.

It also looks like it's sending a field "stop-on-error", which I think should have underscores instead of hyphens.

http://jupyter-client.readthedocs.io/en/latest/messaging.html#execute

cunningjames commented 6 years ago

Thanks a lot! I understand that my thanks plus four dollars will buy you a coffee at Starbucks, but I really do appreciate it.