Answered by:
Unable to load kernel from Jupyter notebook

Question
-
Hi
We suddenly encounter the error KeyError: 'loop" when kernel is loading on jupyter notebook
Here's the stack trace:
Traceback (most recent call last):
File "/anaconda/envs/py35/lib/python3.5/site-packages/traitlets/traitlets.py", line 528, in get
value = obj._trait_values[self.name]
KeyError: 'loop'During handling of the above exception, another exception occurred:Traceback (most recent call last):
File "/anaconda/envs/py35/lib/python3.5/site-packages/notebook/base/handlers.py", line 516, in wrapper
result = yield gen.maybe_future(method(self, *args, **kwargs))
File "/home/bigdata_user1/.local/lib/python3.5/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/anaconda/envs/py35/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/home/bigdata_user1/.local/lib/python3.5/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(*exc_info)
File "/anaconda/envs/py35/lib/python3.5/site-packages/notebook/services/sessions/handlers.py", line 75, in post
type=mtype))
File "/home/bigdata_user1/.local/lib/python3.5/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/anaconda/envs/py35/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/home/bigdata_user1/.local/lib/python3.5/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(*exc_info)
File "/anaconda/envs/py35/lib/python3.5/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/bigdata_user1/.local/lib/python3.5/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/anaconda/envs/py35/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/home/bigdata_user1/.local/lib/python3.5/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(*exc_info)
File "/anaconda/envs/py35/lib/python3.5/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/bigdata_user1/.local/lib/python3.5/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/anaconda/envs/py35/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/home/bigdata_user1/.local/lib/python3.5/site-packages/tornado/gen.py", line 315, in wrapper
yielded = next(result)
File "/anaconda/envs/py35/lib/python3.5/site-packages/notebook/services/kernels/kernelmanager.py", line 94, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "/anaconda/envs/py35/lib/python3.5/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "/anaconda/envs/py35/lib/python3.5/site-packages/jupyter_client/manager.py", line 258, in start_kernel
self.start_restarter()
File "/anaconda/envs/py35/lib/python3.5/site-packages/jupyter_client/ioloop/manager.py", line 49, in start_restarter
kernel_manager=self, loop=self.loop,
File "/anaconda/envs/py35/lib/python3.5/site-packages/traitlets/traitlets.py", line 556, in __get__
return self.get(obj, cls)
File "/anaconda/envs/py35/lib/python3.5/site-packages/traitlets/traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "/anaconda/envs/py35/lib/python3.5/site-packages/traitlets/traitlets.py", line 591, in _validate
value = self.validate(obj, value)
File "/anaconda/envs/py35/lib/python3.5/site-packages/traitlets/traitlets.py", line 1677, in validate
self.error(obj, value)
File "/anaconda/envs/py35/lib/python3.5/site-packages/traitlets/traitlets.py", line 1524, in error
raise TraitError(e)
traitlets.traitlets.TraitError: The 'loop' trait of an IOLoopKernelManager instance must be a ZMQIOLoop, but a value of class 'tornado.platform.asyncio.AsyncIOMainLoop' (i.e. <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7fc9187fd550>) was specified.Any advice on how to solve this?
-Ryan
Wednesday, April 18, 2018 12:42 PM
Answers
-
Hi
I turns out that you need to upgrade on py35 environment of DSVM. here's the steps to resolve the issue
conda update --prefix /anaconda/envs/py35 anaconda
conda update jupyter -n py35
Credits to Le Zhang [MSFT] who help me to resolve the issue
-Ryan
- Marked as answer by Paul Shealy [MSFT]Microsoft employee Thursday, April 19, 2018 4:49 PM
Thursday, April 19, 2018 11:28 AM
All replies
-
Hi,
I haven't seen this error before. Did you update pip or conda packages? You might try updating Jupyter and other conda/pip packages to see if that resolves the issue. I found a similar issue on the Jupyter GitHub page.
Wednesday, April 18, 2018 6:44 PM -
Hi Paul
Yes I've also found that page and try to update the conda and jupyter notebook but the issue still there even I restarted the DSVM
-Ryan
Thursday, April 19, 2018 4:11 AM -
Hi
I turns out that you need to upgrade on py35 environment of DSVM. here's the steps to resolve the issue
conda update --prefix /anaconda/envs/py35 anaconda
conda update jupyter -n py35
Credits to Le Zhang [MSFT] who help me to resolve the issue
-Ryan
- Marked as answer by Paul Shealy [MSFT]Microsoft employee Thursday, April 19, 2018 4:49 PM
Thursday, April 19, 2018 11:28 AM