jupyter / kernel_gateway_demos

Demos associated with the kernel gateway incubator project
BSD 3-Clause "New" or "Revised" License
150 stars 76 forks source link

Error loading server extension nb2kg #56

Closed charlie718y closed 6 years ago

charlie718y commented 6 years ago

Hi,

I'm trying to load the nb2kg Jupyter extension by following the doc provided. I've encountering the following error when starting the Jupyter notebook,

[I 10:47:46.846 NotebookApp] Loaded nb2kg extension [W 10:47:46.846 NotebookApp] Error loading server extension nb2kg Traceback (most recent call last): File "/var/playground/Anaconda/lib/python3.6/site-packages/notebook/notebookapp.py", line 1120, in init_server_extensions func(self) File "/var/playground/kernel_gateway_demos/nb2kg/nb2kg/init.py", line 24, in load_jupyter_server_extension pattern, handlers = web_app.handlers[0] AttributeError: 'NotebookWebApplication' object has no attribute 'handlers'

I used Anaconda to install Jupyter, and I followed the dev steps to enable nb2kg as Jupyter server extension,

config dir: /var/playground/Anaconda/etc/jupyter jupyterlab enabled

1) Started kernel gateway with, jupyter-kernelgateway --ip=${hostname} [KernelGatewayApp] Jupyter Kernel Gateway at http://${hostname}:8889

2) Start notebook with the following script export KG_URL=${hostname}:8889 /var/playground/Anaconda/bin/jupyter notebook \ --ip=${hostname} \ --NotebookApp.session_manager_class=nb2kg.managers.SessionManager \ --NotebookApp.kernel_manager_class=nb2kg.managers.RemoteKernelManager \ --NotebookApp.kernel_spec_manager_class=nb2kg.managers.RemoteKernelSpecManager

3) Observe issue mentioned above

Notebook Version: jupyter notebook --version 4.4.1

Am I doing something wrong?

lresende commented 6 years ago

Looks like NB2KG is failing if labs is active, still investigating the issue. A workaround is to remove labs if you are not really using it.

charlie718y commented 6 years ago

Thanks @lresende. Disabling JupyterLab allowed me to start Jupyter server. Thanks for the reply.

kevin-bates commented 6 years ago

In working with @charlie718y on this, the load exception actually stems from a particular tornado version. The load issue occurs regardless of Jupyter Lab's presence and is completely based on tornado versions >= 4.5.0. Once the version is dropped below 4.5.0, the NB2KG extension loads. (The previous comment didn't have the NB2KG extension installed at the time - false alarm.)

As a result, I would recommend we cap tornado to < 4.5.0 in setup.py and, while we're at it, either extend the notebook version cap to < 6.0 or remove it altogether.

@parente - your opinion is welcome.

kevin-bates commented 6 years ago

Looks like this PR is where the handlers "attribute" was moved: https://github.com/tornadoweb/tornado/pull/1806 I'll try to dig further, but this explains why with v4.5.0 NB2KG no longer loads.