holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.09k stars 105 forks source link

hvplot is not compatible with latest release of bokeh #424

Closed yihming closed 4 years ago

yihming commented 4 years ago

Thanks for contacting us! Please read and follow these instructions carefully, then delete this introductory text to keep your issue easy to read. Note that the issue tracker is NOT the place for usage questions and technical assistance; post those at Discourse instead. Issues without the required information below may be closed immediately.

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc) bokeh 2.0.0, python 3.7.6, hvplot 0.5.2

Description of expected behavior and the observed behavior

hvplot 0.5.2 is not compatible with bokeh 2.0.0, giving the following error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yy939/mgh/miniconda3/envs/pegasus-github/lib/python3.7/site-packages/hvplot/__init__.py", line 12, in <module>
    from .converter import HoloViewsConverter
  File "/Users/yy939/mgh/miniconda3/envs/pegasus-github/lib/python3.7/site-packages/hvplot/converter.py", line 25, in <module>
    from holoviews.plotting.bokeh import OverlayPlot
  File "/Users/yy939/mgh/miniconda3/envs/pegasus-github/lib/python3.7/site-packages/holoviews/plotting/bokeh/__init__.py", line 30, in <module>
    from .annotation import (TextPlot, LineAnnotationPlot, SplinePlot,
  File "/Users/yy939/mgh/miniconda3/envs/pegasus-github/lib/python3.7/site-packages/holoviews/plotting/bokeh/annotation.py", line 23, in <module>
    from .element import AnnotationPlot, ElementPlot, CompositeElementPlot, ColorbarPlot
  File "/Users/yy939/mgh/miniconda3/envs/pegasus-github/lib/python3.7/site-packages/holoviews/plotting/bokeh/element.py", line 23, in <module>
    from bokeh.plotting.helpers import _known_tools as known_tools
ModuleNotFoundError: No module named 'bokeh.plotting.helpers'

But it's compatible with bokeh 1.4.0.

Complete, minimal, self-contained example code that reproduces the issue

pip install --upgrade hvplot
pip install --upgrade bokeh
python
>>> import hvplot

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

epifanio commented 4 years ago

The import issue

from bokeh.plotting.helpers import _known_tools as known_tools
ModuleNotFoundError: No module named 'bokeh.plotting.helpers'

could be replaced with:

from bokeh.plotting._tools import TOOLS_MAP as known_tools

Which gives the next API change issue:

import hvplot.pandas

...python
from bokeh.embed.notebook import encode_utf8, notebook_content
ImportError: cannot import name 'encode_utf8' from 'bokeh.embed.notebook' 

From the Bokeh 2.0.0 release list of changes I see:

philippjfr commented 4 years ago

This has already been fixed in HoloViews and will be addressed once HoloViews 1.13.0 is out (see https://github.com/holoviz/holoviews/issues/4293).

yihming commented 4 years ago

Thank you so much for your clarification!

michaelaye commented 4 years ago

I'm confused, this issue has been closed, and I have Holoviews 1.13.0, so this should be working? I thought @philippjfr 's comment only meant that this WILL BE addressed in hvplot once Holoviews 1.13 is out?

philippjfr commented 4 years ago

This should definitely be fixed as of the HoloViews 1.13 release, i.e. it should be working now.

yihming commented 4 years ago

Yes. My case works now.

michaelaye commented 4 years ago

can't make it work on linux, works on mac in JLab though, despite not having pyviz/jupyterlab_pyviz, but docs say it's needed, confusing. Will make a new issue.

philippjfr commented 4 years ago

Strange, let us know what you find. jupyterlab_pyviz is only needed for comms and therefore interactive features relying on the jupyter kernel to work.

michaelaye commented 4 years ago

Looks like it's a Bokeh problem, will report there.

Screenshot 2020-03-23 20 44 53
philippjfr commented 4 years ago

Looks like the extension wasnt loaded so probably a HoloViews issue if anything.

michaelaye commented 4 years ago

gosh, i wish i could tell you yet if it's Holoviews but it's amazingly hard to find a simple data example code cell that doesn't depend on the assets folder. holoviews' very first example notebook depends on it, but it doesn't say in that notebook what needs to be done to have that assets folder available. :(

michaelaye commented 4 years ago

ok, found it, i was looking for an "installation" section, but because my screen height was just optimally cutting off the main page below the example graphics, the installation section on that page was "invisible" to me. :) Maybe would be good to add a general installation pointer in a TOC somewhere.. Now trying the examples...

michaelaye commented 4 years ago

ok, now i'm stumped. no errors with bokeh itself, and no errors with Holoviews, so why does hvplot create above errors? of course, retrying the hvplot example now, it works. Is there such thing as bokeh needs to be run once before it works maybe? Sorry for the noise...