Hi Adam,

Thanks for the heads up, I'll update the docs to use nbserver_extensions.

The module needs to be importable, so server_extension needs to be in one
of the directories on sys.path. An easy way to do this is to make it a
Python package that can be installed with pip.

Also, it uses the import name of the module, not the filename, so you don't
need the .py extension.

Best wishes,
Thomas

On 24 February 2017 at 18:10, Adam Rule <[email protected]> wrote:

> I am attempting to follow the directions in the Documentation
> <http://jupyter-notebook.readthedocs.io/en/latest/extending/handlers.html#writing-a-notebook-server-extension>
>  for
> writing and installing a custom server extension, but have encountered
> several issues. *How do I install a server extension?* And can the
> documentation be updated?
>
> I copied the example extension code at the end of the documentation to a
> file called `example_server_handler.py` and put this file into a folder
> called `server_extension`
>
>    1. When I ran jupyter notebook --NotebookApp.server_extensions="['
>    server_extension.example_server_handler.py
>    <http://server_extension.example_server_handler.py>']"
>       1.  server_extensions is deprecated, use nbserver_extensions
>    2. When I ran jupyter notebook --NotebookApp.nbserver_extensions="['
>    server_extension.example_server_handler.py
>    <http://server_extension.example_server_handler.py>']"
>       1. The 'nbserver_extensions' trait of a NotebookApp instance must
>       be a dict, but a value of class 'list' (i.e. ['
>       server_extension.example_server_handler.py
>       <http://server_extension.example_server_handler.py>']) was
>       specified.
>    3. When I ran jupyter notebook --NotebookApp.nbserver_extensions="{'
>    server_extension.example_server_handler.py
>    <http://server_extension.example_server_handler.py>': True}"
>       1. ImportError: No module named 'server_extension'
>
> I assume the issue is that I have not actually installed the extension, or
> don't have it on my path.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/612089a9-2a1a-4b80-b154-7b6161e45d3d%40googlegroups.com
> <https://groups.google.com/d/msgid/jupyter/612089a9-2a1a-4b80-b154-7b6161e45d3d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAOvn4qhJrbt7JCQ2B-c7hYguBY-dzu-RuBYUPd1i0QALXv5-iw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to