I want to download the Jupyter Notebook Server Extension to a local directory:
server_ext/ |__ __init__.py |__ extension.py
extension.py
from notebook.utils import url_path_join from notebook.base.handlers import IPythonHandler class HelloWorldHandler(IPythonHandler): def get(self): self.finish('Hello, world!') def load_jupyter_server_extension(nbapp): """ nbapp is istance of Jupyter.notebook.notebookapp.NotebookApp nbapp.web_app is isntance of tornado.web.Application - can register new tornado.web.RequestHandlers to extend API backend. """ nbapp.log.info('My Extension Loaded') web_app = nbapp.web_app host_pattern = '.*$' route_pattern = url_path_join(web_app.settings['base_url'], '/hello') web_app.add_handlers(host_pattern, [(route_pattern, HelloWorldHandler)])
I run the following command from the directory containing server_ext:
jupyter notebook --NotebookApp.server_extensions="['server_ext.extension']"
But I get the error "No module with extension." Is there something I need to do for the Jupyter / python session to recognize the module path?
source share