[IPython-dev] IPython 5.0 and ConfigManager issue

Alan alanwilter at gmail.com
Wed Aug 3 11:07:42 EDT 2016


Many thanks for the replies.

Indeed, based on Thomas', I did:

(slide type: skip)
from notebook.services.config import ConfigManager
from IPython.utils.path import locate_profile
cm = ConfigManager(profile_dir=locate_profile(get_ipython().profile))
cm.update('livereveal', {
              'theme': 'sky',
              'transition': 'cube', # zoom
              'start_slideshow_at': 'selected',
})

I am fine with restarting the kernel. Yet I don't get what Thomas says by
"And you don't need any of the profile stuff - Jupiter".

Well, I am happy with what I got so far.

And for Damian, I am using notebook 4.2.1 an RISE master indeed, but not
using (conda?) environment (I use Fink on my Mac + pip). And how to "you
can also use the notebook metadata..." ?

Many thanks and Many more Thanks for these incredible IPython, Jupyter and
RISE.

Alan

On 2 August 2016 at 18:33, Damián Avila <damianavila at gmail.com> wrote:

> Just to add a little bit more of info... if you are using RISE master and
> notebook 4.2.1, you probably need something like this if you have them
> installed in an environment:
>
> from traitlets.config.manager import BaseJSONConfigManager
> path = "/home/damian/miniconda3/envs/rise_latest/etc/jupyter/nbconfig"
> cm = BaseJSONConfigManager(config_dir=path)
> cm.update('livereveal', {
>     stuff...
> })
>
> where rise_latest is the environment where you have RISE + notebook
> installed...
>
> Alternative, to customize the presentation you can also use the notebook
> metadata... I will be releasing a RISE 4.0.0 beta soon... where some issues
> loading customization from the metadata are solved.
> So you can try customization on the fly... without restarting the notebook
> server nor reloading the page.
>
> 2016-08-02 12:18 GMT-03:00 Thomas Kluyver <takowl at gmail.com>:
>
>> Hi Alan,
>>
>> The import for ConfigManager is now:
>>
>> from notebook.services.config import ConfigManager
>>
>> And you don't need any of the profile stuff - Jupyter, which includes all
>> of the notebook frontend machinery, doesn't have profiles.
>>
>> Thomas
>>
>> On 2 August 2016 at 16:00, Alan <alanwilter at gmail.com> wrote:
>>
>>> Hi there,
>>>
>>> This is not working for me:
>>>
>>> from IPython.html.services.config import ConfigManagerfrom IPython.utils.path import locate_profilecm = ConfigManager(profile_dir=locate_profile(get_ipython().profile))cm.update('livereveal', {
>>>               'theme': 'serif',
>>>               'transition': 'zoom',
>>>               'start_slideshow_at': 'selected',})
>>>
>>> TraitError: The 'parent' trait of a ConfigManager instance must be a Configurable, but a value of class 'NoneType' (i.e. None) was specified.
>>>
>>> It looks like IPY 5 changed the way it handles the configuration?
>>>
>>> I have these warning in my prompt:
>>>
>>> /sw/lib/python3.5/site-packages/IPython/utils/traitlets.py:5:
>>> UserWarning: IPython.utils.traitlets has moved to a top-level traitlets
>>> package.
>>>
>>>   warn("IPython.utils.traitlets has moved to a top-level traitlets
>>> package.")
>>>
>>> /sw/lib/python3.5/site-packages/IPython/utils/path.py:283: UserWarning:
>>> locate_profile has moved to the IPython.paths module
>>>
>>>   warn("locate_profile has moved to the IPython.paths module")
>>>
>>> But I don't know how to fix it. I am using ipython/jupyter + RISE and I
>>> want to customise my presentations.
>>>
>>> Thanks,
>>>
>>> Alan
>>>
>>> --
>>> Alan Wilter SOUSA da SILVA, DSc
>>> Senior Bioinformatician, UniProt
>>> European Bioinformatics Institute (EMBL-EBI)
>>> European Molecular Biology Laboratory
>>> Wellcome Trust Genome Campus
>>> Hinxton
>>> Cambridge CB10 1SD
>>> United Kingdom
>>> Tel: +44 (0)1223 494588
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
>
> --
> *Damián*
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>


-- 
Alan Wilter SOUSA da SILVA, DSc
Senior Bioinformatician, UniProt
European Bioinformatics Institute (EMBL-EBI)
European Molecular Biology Laboratory
Wellcome Trust Genome Campus
Hinxton
Cambridge CB10 1SD
United Kingdom
Tel: +44 (0)1223 494588
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20160803/4b8f4022/attachment.html>


More information about the IPython-dev mailing list