[IPython-dev] How to load an extension into every notebook on a server
Ian Stokes Rees
ijstokes at alumni.uwaterloo.ca
Thu Jan 7 23:47:20 EST 2016
Hi Ted,
This is "active work in progress". We (at Continuum) came up with our
own solution to this problem but in doing so we had an extensive
discussion with the Jupyter team and agreed on a more general way to
solve the issue that is "work-in-progress". As such, I'd encourage you
to "watch this space" until we have the work completed. If you are
really keen to try and get this working now then you could look at what
we put together via:
https://github.com/Anaconda-Server/generator-nbextension
https://github.com/Anaconda-Server/nbsetuptools
https://github.com/Anaconda-Server/nb_config_manager
And here is an example:
https://github.com/Anaconda-Server/nb_helloworld
NOTE: We don't recommend that you use this right now. It works, but it
has been constructed very specifically for some of our current (internal
and client-specific) use cases in environments which are
Anaconda-centric. You'd be much better off waiting until we have this
adapted to the new format, if you have the luxury of time.
Cheers,
Ian
On 1/5/16 4:35 PM, Ted Liefeld wrote:
> 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 <mailto: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 <mailto:IPython-dev at scipy.org>
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
>
> --
> Ted Liefeld UC San Diego
> Mesirov Lab liefeld at ucsd.edu <mailto:liefeld at ucsd.edu>
> Office 2A24, BRF-II 858-534-2010
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
Ian Stokes-Rees
617.942.0218
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20160107/a8443efe/attachment.html>
More information about the IPython-dev
mailing list