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

Kernel started from ein:run does not respond #688

Closed bbolvig closed 4 years ago

bbolvig commented 4 years ago

Just getting setup with ipython-notebook layer in spacemacs here.

Using ein:login to a running server works fine but if I use ein:run to start jupyter the kernel never returns when executing a cell (forever [*])

Ein version:

     Status: Installed in ‘ein-20200314.443/’ (unsigned).
    Version: 20200314.443

0.300.0@26.3 (spacemacs) develop@2049817b1

not sure how to debug this, so happy to provide more details if you ask me what to look for

dickmao commented 4 years ago

Output of *ein:log-all* and *ein server*.

Before you dump that, restart spacemacs so that the output of the above only reflect your ein:run attempt and single cell execution, and nothing else.

bbolvig commented 4 years ago

Output of *ein:log-all* and *ein server*.

As suggested I've executed ein:run, opened a notebook and executed a single cell.

*ein:log-all*:

21:27:30:018: [info] ein:jupyter-server--run: /home/b/.pyenv/shims/jupyter notebook --notebook-dir=/home/b/work/ --no-browser @#<buffer *spacemacs*>
21:27:30:763: [info] ein:jupyter-process-lines: jupyter exited with status 1 @#<buffer *spacemacs*>
21:27:30:853: [info] Login to http://127.0.0.1:8888 complete. @#<buffer *spacemacs*>
21:27:30:980: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer *spacemacs*>
21:28:43:548: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
21:28:43:551: [verbose] Opened notebook Untitled.ipynb @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
21:28:43:553: [info] Worksheet Untitled.ipynb is ready @#<buffer *ein: http://127.0.0.1:8888/Untitled.ipynb*>
21:28:44:055: [verbose] ein:kernel-retrieve-session--success: kernel-id=ff48b2dd-8ffc-4fb3-a986-d789931f75b9 session-id=39c4fcb4-1ff0-4245-af59-cacdcbdf76c8 @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
21:28:44:055: [verbose] WS start: ws://127.0.0.1:8888/api/kernels/ff48b2dd-8ffc-4fb3-a986-d789931f75b9/channels?session_id=39c4fcb4-1ff0-4245-af59-cacdcbdf76c8 @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
21:28:48:966: [info] Notebook Untitled.ipynb is already open @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
21:28:49:016: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>
21:28:49:021: [verbose] Notebook is saved. @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>
21:28:54:103: [info] Notebook Untitled.ipynb is ready @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>
21:28:54:104: [verbose] WS opened: ws://127.0.0.1:8888/api/kernels/ff48b2dd-8ffc-4fb3-a986-d789931f75b9/channels?session_id=39c4fcb4-1ff0-4245-af59-cacdcbdf76c8 @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>
21:28:54:116: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>

*ein server*:

[I 21:27:30.452 NotebookApp] [m Serving notebooks from local directory: /home/b/work
[I 21:27:30.452 NotebookApp] [m 0 active kernels
[I 21:27:30.452 NotebookApp] [m The Jupyter Notebook is running at:
[I 21:27:30.452 NotebookApp] [m http://localhost:8888/?token=ae429feac237fd277cbc190c6da6bacf2e9d8aed58949f8d
[I 21:27:30.452 NotebookApp] [m Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 21:27:30.452 NotebookApp] 

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=ae429feac237fd277cbc190c6da6bacf2e9d8aed58949f8d
[I 21:27:30.791 NotebookApp] [m 302 POST /login (127.0.0.1) 1.10ms
[I 21:27:30.792 NotebookApp] [m 302 GET / (127.0.0.1) 0.28ms
[I 21:28:43.505 NotebookApp] [m Creating new notebook in 
[I 21:28:44.047 NotebookApp] [m Kernel started: ff48b2dd-8ffc-4fb3-a986-d789931f75b9
ERROR:tornado.general:Uncaught exception in ZMQStream callback
Traceback (most recent call last):
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 438, in _run_callback
    callback(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    self.pre_handler_hook()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 248, in pre_handler_hook
    self.saved_sigint_handler = signal(SIGINT, default_int_handler)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
ERROR:tornado.general:Uncaught exception in zmqstream callback
Traceback (most recent call last):
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 456, in _handle_events
    self._handle_recv()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 486, in _handle_recv
    self._run_callback(callback, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 438, in _run_callback
    callback(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    self.pre_handler_hook()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 248, in pre_handler_hook
    self.saved_sigint_handler = signal(SIGINT, default_int_handler)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
ERROR:tornado.application:Exception in callback (<zmq.sugar.socket.Socket object at 0x7fa682453670>, <function wrap.<locals>.null_wrapper at 0x7fa682469680>)
Traceback (most recent call last):
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/tornado/ioloop.py", line 888, in start
    handler_func(fd_obj, events)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 456, in _handle_events
    self._handle_recv()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 486, in _handle_recv
    self._run_callback(callback, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 438, in _run_callback
    callback(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    self.pre_handler_hook()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 248, in pre_handler_hook
    self.saved_sigint_handler = signal(SIGINT, default_int_handler)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
[I 21:28:48.992 NotebookApp] [m Saving file at /Untitled.ipynb
[W 21:28:54.083 NotebookApp] [m Timeout waiting for kernel_info reply from ff48b2dd-8ffc-4fb3-a986-d789931f75b9
...same Traceback again

EDIT:

The following *Warnings* popped up after ein:worksheet-execute-cell:

Error (ein): Undo failure diagnostic (nil (10 . 22) (1 . -10) (  . -11) (+ . -12) (12 . 13) (10 . 12) (x . -10) (10 . 11) (t . 0)) (5ecd4 5ecd4 5ecd4 5ecd4 5ecd4 5ecd4 5ecd4 5ecd4 5ecd4 5ecd4 5ecd4 5ecd4 5ecd4 5ecd4) | -4
dickmao commented 4 years ago

Try running jupyter notebook list --json from the command line after running ein:run. What does it say?

As suggested in the README, copying the output of ein:dev-bug-report-template would provide further color to your situation.

bbolvig commented 4 years ago
$ jupyter notebook list --json
{"base_url": "/", "hostname": "localhost", "notebook_dir": "/home/b/work", "password": false, "pid": 14553, "port": 8888, "secure": false, "token": "a460ee9a5d87969babdaf5bb4de9860828aadd8ed2acd110", "url": "http://localhost:8888/"}

If I use the web client to access the server started in ein, I get the same kind of behaviour. "Kernel Busy...", never comes back.

Thanks for the hint. Missing bits from bug report:

System info:

("EIN system info"
 :emacs-version
 "GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-09-16"
 :emacs-bzr-version nil
 :window-system x
 :emacs-variant spacemacs
 :os
 (:uname
  "Linux b-TUX 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
"
  :lsb-release
  "No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic
")
 :notebook
 "Name: notebook
Version: 5.2.2
Summary: A web-based notebook environment for interactive computing
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter@googlegroups.com
License: BSD
Location: /home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages
Requires: traitlets, jupyter-client, nbconvert, nbformat, ipython-genutils, tornado, terminado, jupyter-core, ipykernel, jinja2
Required-by: jupyterlab, jupyterlab-server, google-colab
"
 :ipython "5.5.0
"
 :image-types
 (svg imagemagick png gif tiff jpeg xpm xbm pbm postscript)
 :image-types-available
 (svg imagemagick png gif tiff jpeg xpm xbm pbm postscript)
 :request
 (:backend curl)
 :ein
 (:version "20200314.443"
           :source-dir "/home/b/.emacs.d/elpa/26.3/develop/ein-20200314.443/")
 :lib
 ((:name "emacs"
         :path "/usr/share/emacs/site-lisp/llvm-6.0/emacs.el"
         :featurep t
         :version-var emacs-version
         :version "26.3")
  (:name "websocket"
         :path "~/.emacs.d/elpa/26.3/develop/websocket-20200102.637/websocket.elc"
         :featurep t
         :version-var websocket-version
         :version "1.12")
  (:name "anaphora"
         :path "~/.emacs.d/elpa/26.3/develop/anaphora-20180618.2200/anaphora.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "request"
         :path "~/.emacs.d/elpa/26.3/develop/request-20200219.2257/request.elc"
         :featurep t
         :version-var request-version
         :version "0.3.0")
  (:name "deferred"
         :path "~/.emacs.d/elpa/26.3/develop/deferred-20170901.1330/deferred.elc"
         :featurep t
         :version-var deferred:version
         :version "0.5.0")
  (:name "polymode"
         :path "~/.emacs.d/elpa/26.3/develop/polymode-20200316.1314/polymode.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "dash"
         :path "~/.emacs.d/elpa/26.3/develop/dash-20200119.2310/dash.elc"
         :featurep t
         :version-var nil
         :version nil)))
dickmao commented 4 years ago

Your python modules (notebook==5.2.2 and ipython==5.5.0) are very old. We only test ipython>=5.8.0.

Your jupyter notebook list --json output looks good, but for whatever reason EIN noticed it returned with a non-zero exit code. It suggests the jupyter you're running from the command line is different from the jupyter running in EIN. I just committed c4a9013 which should error out sooner when jupyter notebook list --json exits non-zero.

I would apt update your jupyter modules for a start.

bbolvig commented 4 years ago

thanks for picking that out. venv troubles :/

I still haven't got it working unfortunately

Problem description

As before, the notebook server started from ein:run doesn't work. Now it gets stuck after "Kernel reconnected" upon executing a cell

from *ein server*:

ERROR:tornado.general:Uncaught exception in ZMQStream callback
Traceback (most recent call last):
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 438, in _run_callback
    callback(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    self.pre_handler_hook()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 248, in pre_handler_hook
    self.saved_sigint_handler = signal(SIGINT, default_int_handler)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
ERROR:tornado.general:Uncaught exception in zmqstream callback
Traceback (most recent call last):
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 456, in _handle_events
    self._handle_recv()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 486, in _handle_recv
    self._run_callback(callback, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 438, in _run_callback
    callback(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    self.pre_handler_hook()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 248, in pre_handler_hook
    self.saved_sigint_handler = signal(SIGINT, default_int_handler)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
Traceback (most recent call last):
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance
    app.start()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/tornado/platform/asyncio.py", line 149, in start
    self.asyncio_loop.run_forever()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/asyncio/base_events.py", line 525, in run_forever
    raise RuntimeError('This event loop is already running')
ERROR:tornado.application:Exception in callback functools.partial(<function ZMQStream._update_handler.<locals>.<lambda> at 0x7f7a947a1b00>)
Traceback (most recent call last):
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/tornado/ioloop.py", line 743, in _run_callback
    ret = callback()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 542, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 456, in _handle_events
    self._handle_recv()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 486, in _handle_recv
    self._run_callback(callback, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 438, in _run_callback
    callback(*args, **kwargs)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    self.pre_handler_hook()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 248, in pre_handler_hook
    self.saved_sigint_handler = signal(SIGINT, default_int_handler)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
RuntimeError: This event loop is already running
[I 00:29:09.394 NotebookApp](B KernelRestarter: restarting kernel (1/5), new random ports
[I 00:29:09.736 NotebookApp](B Saving file at /Untitled.ipynb
Traceback (most recent call last):
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance
    app.start()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/tornado/platform/asyncio.py", line 149, in start
    self.asyncio_loop.run_forever()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/asyncio/base_events.py", line 525, in run_forever
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
[I 00:29:12.402 NotebookApp](B KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance
    app.start()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/ipykernel/kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages/tornado/platform/asyncio.py", line 149, in start
    self.asyncio_loop.run_forever()
  File "/home/b/.pyenv/versions/3.7.6/lib/python3.7/asyncio/base_events.py", line 525, in run_forever
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
...etc

*ein:log-all*:

00:28:57:394: [info] ein:jupyter-server--run: /home/b/.pyenv/shims/jupyter notebook --notebook-dir=/home/b/work/chai/ --no-browser @#<buffer predict.py>
00:28:58:802: [info] Login to http://127.0.0.1:8888 complete. @#<buffer predict.py>
00:28:58:883: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer predict.py>
00:29:05:903: [verbose] Opened notebook Untitled.ipynb @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
00:29:05:905: [info] Worksheet Untitled.ipynb is ready @#<buffer *ein: http://127.0.0.1:8888/Untitled.ipynb*>
00:29:06:539: [verbose] ein:kernel-retrieve-session--success: kernel-id=255ed753-e660-4452-a984-1b12111fb6d8 session-id=96b7f6c9-c7d5-40db-923f-9c1675b7b952 @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
00:29:06:540: [verbose] WS start: ws://127.0.0.1:8888/api/kernels/255ed753-e660-4452-a984-1b12111fb6d8/channels?session_id=96b7f6c9-c7d5-40db-923f-9c1675b7b952 @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
00:29:06:565: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
00:29:09:718: [info] Notebook Untitled.ipynb is already open @#<buffer *ein:notebooklist http://127.0.0.1:8888*>
00:29:09:776: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>
00:29:09:778: [verbose] Notebook is saved. @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>
00:29:18:682: [verbose] Kernel 255ed753-e660-4452-a984-1b12111fb6d8 unavailable @#<buffer *ein: http://127.0.0.1:8888/Untitled.ipynb*>
00:29:18:713: [verbose] ein:kernel-session-p--success: session-id=96b7f6c9-c7d5-40db-923f-9c1675b7b952 session-p=t @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>
00:29:18:728: [verbose] ein:kernel-retrieve-session--success: kernel-id=255ed753-e660-4452-a984-1b12111fb6d8 session-id=96b7f6c9-c7d5-40db-923f-9c1675b7b952 @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>
00:29:18:728: [verbose] WS start: ws://127.0.0.1:8888/api/kernels/255ed753-e660-4452-a984-1b12111fb6d8/channels?session_id=96b7f6c9-c7d5-40db-923f-9c1675b7b952 @#<buffer  *ein: http://127.0.0.1:8888/Untitled.ipynb*[python]>

Steps to reproduce the problem

ein:run followed by ein:worksheet-execute-cell

System info:

("EIN system info"
 :emacs-version
 "GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-09-16"
 :emacs-bzr-version nil
 :window-system x
 :emacs-variant spacemacs
 :os
 (:uname
  "Linux b-TUX 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
"
  :lsb-release
  "No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic
")
 :notebook
 "Name: notebook
Version: 6.0.3
Summary: A web-based notebook environment for interactive computing
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter@googlegroups.com
License: BSD
Location: /home/b/.pyenv/versions/3.7.6/lib/python3.7/site-packages
Requires: tornado, jupyter-core, jupyter-client, traitlets, ipython-genutils, terminado, nbformat, Send2Trash, jinja2, ipykernel, prometheus-client, nbconvert, pyzmq
Required-by: widgetsnbextension, jupyterlab, jupyterlab-server, jupyter, google-colab
"
 :ipython "7.13.0
"
 :image-types
 (svg imagemagick png gif tiff jpeg xpm xbm pbm postscript)
 :image-types-available
 (svg imagemagick png gif tiff jpeg xpm xbm pbm postscript)
 :request
 (:backend curl)
 :ein
 (:version "20200314.443"
           :source-dir "/home/b/.emacs.d/elpa/26.3/develop/ein-20200314.443/")
 :lib
 ((:name "emacs"
         :path "/usr/share/emacs/site-lisp/llvm-6.0/emacs.el"
         :featurep t
         :version-var emacs-version
         :version "26.3")
  (:name "websocket"
         :path "~/.emacs.d/elpa/26.3/develop/websocket-20200102.637/websocket.elc"
         :featurep t
         :version-var websocket-version
         :version "1.12")
  (:name "anaphora"
         :path "~/.emacs.d/elpa/26.3/develop/anaphora-20180618.2200/anaphora.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "request"
         :path "~/.emacs.d/elpa/26.3/develop/request-20200219.2257/request.elc"
         :featurep t
         :version-var request-version
         :version "0.3.0")
  (:name "deferred"
         :path "~/.emacs.d/elpa/26.3/develop/deferred-20170901.1330/deferred.elc"
         :featurep t
         :version-var deferred:version
         :version "0.5.0")
  (:name "polymode"
         :path "~/.emacs.d/elpa/26.3/develop/polymode-20200316.1314/polymode.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "dash"
         :path "~/.emacs.d/elpa/26.3/develop/dash-20200119.2310/dash.elc"
         :featurep t
         :version-var nil
         :version nil)))
dickmao commented 4 years ago

Errors in the notebook server (tornado related errors) are outside EIN's scope.

It's clear your venv contains libraries that aren't compatible. I would google ERROR:tornado.general:Uncaught exception in ZMQStream callback and proceed from there.

bbolvig commented 4 years ago

Thanks for your help, updating dependencies ultimately fixed it form me.