[IPython-dev] Question about the stability of the api

Matthias Bussonnier bussonniermatthias at gmail.com
Thu Aug 20 02:53:31 EDT 2015


Hi Fred, 


> On Aug 20, 2015, at 08:25, Fred Jendrzejewski <fred.jendrzejewski at gmail.com> wrote:
> 
> Hello everyone,
> 
> I started working with a third party package (pymc3) in ipython4 I get some errors that seem concern changes in the api of ipython:
> 
> ShimWarning: The `IPython.html` package has been deprecated. You should 
> import from `notebook` instead. `IPython.html.widgets` has moved to
> `ipywidgets`. "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
> ./lib/python3.4/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."
> Before we wanted to start the debugging procedure, we wanted to ask how stable this part of the ipython API is. In other words, is it worth to find a clean fix or will this change within a short time frame anyway again ?
> 

These are just warnings

You can just replace 

import IPython.html.widgets 

by 

try: 
   import ipywidgets
except ImportErrror:
  import IPython.html.widgets.

(same with traitlets)

Or actually do a conditional import depending on the IPython version. 
  
The stability depends on each package, that know have their own version numbers, so the stability will depends on each specific package. 
They will most likely not move again before a few years. 
-- 
M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150820/02a57a46/attachment.html>


More information about the IPython-dev mailing list