Hi,
Just noticed the following warning when importing seaborn:
/home/phyks/.local/share/virtualenvs/physique/lib/python3.5/site-packages/IPython/html.py:14: 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)
Although it is just a deprecation warning, and should not really matter, I did not find any issue about this, so here is one.
Thanks
Try pip install ipywidgets. Seaborn does try to import there, and falls back for users who haven't upgraded their own environment yet.
Ok, it is indeed deleting the warning. :)
Is there a specific reason not to include this package in the dependencies?
The widgets aren't really a "core" part of the library (though Michael can disagree). You can easily use seaborn without ipython/jupyter, so it wouldn't make sense to require one of their dependencies without requiring IPython itself.
Ok. My point is that there could be a conditional in the setup.py to require the widgets if iPython / jupyter is installed.
And if seaborn is including them, without having ipywidgets, it could issue an error message about it? (I must admit I did not fully understand the problem when first encountered it). Especially since, if I understood correctly, the old interface is deprecated and may be removed soon.
The widgets are completely optional, and there's no reason to error out if they can't be found. Normally if you didn't have ipywidgets installed things would work perfectly fine, aside from some functions not being available (the choose_*_palette functions). There is a warning due to backwards compatibility layers in newer versions of IPython saying "hey, you used to be able to get the widgets from here, but you won't be able to soon." But that gets raised because seaborn tries to import from there after trying to the newest way so as not to break for people who are stuck on older versions of IPython for whatever reason. Anyway, a little annoying given that things are moving around rapidly in IPython, but that should settle down soon. As Tom says, if you want the warning message to go away, install ipywidgets, but if you're not using those functions, it's nothing to be concerned about.
Ok :) Thanks for the infos.
@mwaskom it is not "completely" fine. If I import seaborn in python script and run in "&" mode, so I can exit session and script still runs, it shows the message "[1]+ Stopped " instead of warning. And script does not work
Most helpful comment
Try
pip install ipywidgets. Seaborn does try to import there, and falls back for users who haven't upgraded their own environment yet.