Notebook: jupyter notebook IOLoop is already running and kernel error

Created on 11 Apr 2018  ·  5Comments  ·  Source: jupyter/notebook

- when i start the notebook from the terminal:

jcc@jcc:~$ jupyter notebook
[I 16:56:53.558 NotebookApp] Serving notebooks from local directory: /home/jcc
[I 16:56:53.559 NotebookApp] 0 active kernels
[I 16:56:53.559 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=6f905015a24d05c698467e7e66fb66889cc1f79039f505e9
[I 16:56:53.559 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:56:53.560 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:8888/?token=6f905015a24d05c698467e7e66fb66889cc1f79039f505e9

GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
Fontconfig warning: "/etc/fonts/fonts.conf", line 146: blank doesn't take any effect anymore. please remove it from your fonts.conf
[1425:1445:0411/165653.901027:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /home/jcc/anaconda2/var/run/dbus/system_bus_socket: 没有那个文件或目录
[I 16:56:54.123 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[1425:1463:0411/165654.136923:ERROR:browser_gpu_channel_host_factory.cc(120)] Failed to launch GPU process.
已在现有的浏览器会话中创建新的窗口。

- and

then i build the new python2 file in notebook:

image
and in the terminal:
[I 16:59:50.917 NotebookApp] Creating new notebook in
[E 16:59:51.564 NotebookApp] Unhandled error in API request
Traceback (most recent call last):
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/base/handlers.py", line 503, in wrapper
result = yield gen.maybe_future(method(self, args, kwargs))
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/concurrent.py", line 260, in result
raise_exc_info(self._exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(
exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/services/sessions/handlers.py", line 75, in post
type=mtype))
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/concurrent.py", line 260, in result
raise_exc_info(self._exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/concurrent.py", line 260, in result
raise_exc_info(self._exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(
exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/concurrent.py", line 260, in result
raise_exc_info(self._exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 315, in wrapper
yielded = next(result)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/services/kernels/kernelmanager.py", line 87, in start_kernel
super(MappingKernelManager, self).start_kernel(
kwargs)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
km.start_kernel(*kwargs)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/jupyter_client/manager.py", line 244, in start_kernel
self.start_restarter()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/jupyter_client/ioloop/manager.py", line 52, in start_restarter
self._restarter.start()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/jupyter_client/ioloop/restarter.py", line 45, in start
self.poll, 1000
self.time_to_dead, self.loop
TypeError: __init__() takes exactly 3 arguments (4 given)
[E 16:59:51.567 NotebookApp] {
"Origin": "http://localhost:8888",
"Content-Length": "92",
"Accept-Language": "zh-CN,zh;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"X-Xsrftoken": "2|b7d1fbe8|fbee8b1748e7c180868d61062e5a9c01|1523167004",
"Host": "localhost:8888",
"Accept": "application/json, text/javascript, /; q=0.01",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
"Connection": "keep-alive",
"X-Requested-With": "XMLHttpRequest",
"Referer": "http://localhost:8888/notebooks/Untitled8.ipynb?kernel_name=python2",
"Cookie": "_xsrf=2|b7d1fbe8|fbee8b1748e7c180868d61062e5a9c01|1523167004; username-localhost-8889=\"2|1:0|10:1523435672|23:username-localhost-8889|44:N2UxMzY1YjMyYjQ1NGM2NmI3NTkwN2NjMzM0M2FmY2Q=|74da3f535f2a99218b429c138ca58bd921f7c2fafe339b82b1d3e2a2eac939d9\"; username-localhost-8890=\"2|1:0|10:1523435968|23:username-localhost-8890|44:NWNiMWY1ZWUwMmU2NDJlM2JmZmY2YzcxYWM5ZDE2M2Q=|dc12b75db9e01422a0c8a68158b4532518aee314af5545b4814dee69a4666337\"; username-localhost-8888=\"2|1:0|10:1523437014|23:username-localhost-8888|44:ZWU0YzI1OGNjNjA4NGQxODg4ZjQxODM3NGU5NjliMGE=|485fe0142ffed09bf0c03365919c01aaf03832e49f41e18e591c330b85840b1b\"",
"Content-Type": "application/json"
}
[E 16:59:51.567 NotebookApp] 500 POST /api/sessions (::1) 29.46ms referer=http://localhost:8888/notebooks/Untitled8.ipynb?kernel_name=python2
Traceback (most recent call last):
File "/home/jcc/anaconda2/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/home/jcc/anaconda2/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/jcc/anaconda2/lib/python2.7/site-packages/ipykernel/__main__.py", line 3, in
app.launch_new_instance()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 474, in start
ioloop.IOLoop.instance().start()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/ioloop.py", line 929, in start
raise RuntimeError("IOLoop is already running")

RuntimeError: IOLoop is already running

- in

the kernel error:

image

Traceback (most recent call last):
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/base/handlers.py", line 503, in wrapper
result = yield gen.maybe_future(method(self, args, kwargs))
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/concurrent.py", line 260, in result
raise_exc_info(self._exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(
exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/services/sessions/handlers.py", line 75, in post
type=mtype))
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/concurrent.py", line 260, in result
raise_exc_info(self._exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/concurrent.py", line 260, in result
raise_exc_info(self._exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(
exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/concurrent.py", line 260, in result
raise_exc_info(self._exc_info)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/tornado/gen.py", line 315, in wrapper
yielded = next(result)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/notebook/services/kernels/kernelmanager.py", line 87, in start_kernel
super(MappingKernelManager, self).start_kernel(
kwargs)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
km.start_kernel(*kwargs)
File "/home/jcc/anaconda2/lib/python2.7/site-packages/jupyter_client/manager.py", line 244, in start_kernel
self.start_restarter()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/jupyter_client/ioloop/manager.py", line 52, in start_restarter
self._restarter.start()
File "/home/jcc/anaconda2/lib/python2.7/site-packages/jupyter_client/ioloop/restarter.py", line 45, in start
self.poll, 1000
self.time_to_dead, self.loop
TypeError: __init__() takes exactly 3 arguments (4 given)

and
image

i dont know how to fix it .please help me .

Most helpful comment

pip install --upgrade --ignore-installed notebook and solve it!

All 5 comments

I think you need to upgrade the jupyter_client package to be compatible with tornado 5.

@takluyver sorry , when I follow the step in https://github.com/jupyter/jupyter_client ,when I execute the line
py.test
it meet so many question in this command .
==========9 failed,89 passed, 1 skipped in 24.72 seconds================
and it still have the runtime error: IOloop is already running

i am broken down for this now

You don't need to do that. Probably conda update jupyter_client (if you installed Jupyter through conda originally)

pip install --upgrade --ignore-installed notebook and solve it!

Great!

Was this page helpful?
0 / 5 - 0 ratings