[IPython-dev] How to load an extension into every notebook on a server

Ted Liefeld liefeld at broadinstitute.org
Tue Jan 5 17:35:42 EST 2016


Ian

So it seems that (delayed response due to the holiday season) its not
actually possible to do this now using the example in 879
<https://github.com/jupyter/notebook/issues/879> unless I go to a
development build, or is there currently a way to do that by editing my
notebook.json file which seems to be implied by the discussion at the top
of 878 <https://github.com/jupyter/notebook/issues/878>.  For the moment
this would work fine for our container since it is single user and we
control the files in the container.

Speaking of which I cannot seem to figure out the right mojo to get the
notebook.json file (in the intro in 878 it refers to paths.jupyter_path('
nbextensions') but the "paths" variable is not present in my notebook, do I
need to run python in the container to access this variable?

Also, what is the root path for loading extensions like this?  The examples
don't make that clear, so I have this at the moment (note this is in a
docker container so its not really running as root)

# pwd
/root/.jupyter/nbconfig
# more notebook.json
{
  "load_extensions" : {
       "genepattern" : true
       }

}


while the extension installed (via pip) in

/root/.jupyter/custom/genepattern


This, of course, does not actually work though

Thanks

Ted

On Sun, Jan 3, 2016 at 3:58 AM, Ian Stokes Rees <
ijstokes at alumni.uwaterloo.ca> wrote:

> Ted,
>
> Now that I'm back online, the reference I should have provided was this
> one:
>
> https://github.com/jupyter/notebook/issues/878
>
> That issue is the core discussion around Jupyter 4.2 modifications to
> support better extension configuration.  A number of PRs have already been
> created and merged, but I believe the "main" open one is:
>
> https://github.com/jupyter/notebook/pull/879
>
> Regards.
>
> Ian
>
> On 1/2/16 1:25 PM, Ian Stokes Rees wrote:
>
> Hi Ted (and Thomas),
>
> At Continuum we are also interested in having pre-configured notebook
> environments and are actively working with the Jupyter team to figure out
> good ways of enabling "universal" configuration of extensions in Jupyter 4
> (for others: prior to the complete reworking of the "extension" mechanism
> which will arrive with Jupyter 5).
>
> I'm offline now, otherwise I'd provide you with some links to the
> discussion, but you can dig up a reference if you look at the JEP area of
> the Jupyter GitHub repos.  I think this is the link:
>
> https://github.com/jupyter/enhancement-proposals/pull/7
>
> That is probably way too much detail for what you're looking for, but I,
> for one, would like to come up with a solution that would make your
> GeneExpression extension "pre-loadable" with no extra work on the part of
> the user.
>
> Cheers,
>
> Ian
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>


-- 
Ted Liefeld                                      UC San Diego
Mesirov Lab                                    liefeld at ucsd.edu

Office 2A24, BRF-II                        858-534-2010
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20160105/5a86d145/attachment.html>


More information about the IPython-dev mailing list