Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685228 - dev-python/notebook-5.7.8 fails to start functional (py2 or py3) kernel, repeated RuntimeError: IOLoop is already running
Summary: dev-python/notebook-5.7.8 fails to start functional (py2 or py3) kernel, repe...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-06 21:10 UTC by Sebastian Pipping
Modified: 2021-02-24 20:20 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Pipping gentoo-dev 2019-05-06 21:10:01 UTC
When running "jupyter notebook", no functional kernel can be provided to start hacking on a notebook.  The output keeps reading:


[I 22:53:23.549 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib64/python2.7/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/usr/lib64/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/lib64/python2.7/site-packages/ipykernel/kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "/usr/lib64/python2.7/site-packages/tornado/ioloop.py", line 937, in start
    raise RuntimeError("IOLoop is already running")
RuntimeError: IOLoop is already running


This upstream bug issue might be related — https://github.com/jupyter/notebook/issues/3397 — however, portage does not me downgrade tornado to 4.5.3 as that ticket might suggest and in a fresh virtualenv, "jupyter notebook" works fin with either Tornado 5.1 and 6.0.2.
Comment 1 Jari_42 2020-03-16 11:34:24 UTC
While downgrading tornado to 4.5.3 fixed the IOLoop error for me, I was also getting the following error:

ERROR:tornado.general:Uncaught exception in ZMQStream callback
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/usr/lib64/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/usr/lib64/python3.6/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/usr/lib64/python3.6/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    self.pre_handler_hook()
  File "/usr/lib64/python3.6/site-packages/ipykernel/kernelbase.py", line 248, in pre_handler_hook
    self.saved_sigint_handler = signal(SIGINT, default_int_handler)
  File "/usr/lib64/python3.6/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread

which according to upstream https://github.com/ipython/ipykernel/issues/335 I fixed by upgrading ipykernel to 4.8.2. When I subsequently upgraded tornado back to 5.1 everything worked fine. 

Maybe ipykernel 4.8.2 should be stabilised?
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-02-24 20:20:40 UTC
Closing bugs reported for old versions, no longer in ::gentoo.  Please reopen if you can still reproduce.