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.14k stars 108 forks source link

hvplot 0.4.0 breaks with holoviews version 1.12.1 #196

Closed mdk73 closed 5 years ago

mdk73 commented 5 years ago

After upgrading Holoviews to version 1.12.1 I get an import error with hvplot version 0.4.0.

import hvplot

gives

ImportError                               Traceback (most recent call last)
<ipython-input-1-5d62e345fd68> in <module>
----> 1 import hvplot

c:\program files\python37\lib\site-packages\hvplot\__init__.py in <module>
     12 from holoviews import Store
     13 
---> 14 from .converter import HoloViewsConverter
     15 from .util import get_ipy
     16 from .utilities import save, show # noqa

c:\program files\python37\lib\site-packages\hvplot\converter.py in <module>
     21     Violin, Contours, Polygons, Points, Path, Labels, RGB
     22 )
---> 23 from holoviews.plotting.bokeh import OverlayPlot
     24 from holoviews.plotting.util import process_cmap
     25 from holoviews.operation import histogram

c:\program files\python37\lib\site-packages\holoviews\plotting\bokeh\__init__.py in <module>
     28     DFrame = None
     29 
---> 30 from .annotation import (TextPlot, LineAnnotationPlot, SplinePlot,
     31                          ArrowPlot, DivPlot, LabelsPlot)
     32 from ..plot import PlotSelector

c:\program files\python37\lib\site-packages\holoviews\plotting\bokeh\annotation.py in <module>
     21 from ...element import HLine
     22 from ..plot import GenericElementPlot
---> 23 from .element import AnnotationPlot, ElementPlot, CompositeElementPlot, ColorbarPlot
     24 from .styles import text_properties, line_properties
     25 from .plot import BokehPlot

c:\program files\python37\lib\site-packages\holoviews\plotting\bokeh\element.py in <module>
     32 from ..plot import GenericElementPlot, GenericOverlayPlot
     33 from ..util import dynamic_update, process_cmap, color_intervals, dim_range_key
---> 34 from .callbacks import PlotSizeCallback
     35 from .plot import BokehPlot
     36 from .styles import (

c:\program files\python37\lib\site-packages\holoviews\plotting\bokeh\callbacks.py in <module>
     20 from ..links import Link, RangeToolLink, DataLink
     21 from ..plot import GenericElementPlot, GenericOverlayPlot
---> 22 from .util import convert_timestamp, bokeh_version
     23 
     24 

c:\program files\python37\lib\site-packages\holoviews\plotting\bokeh\util.py in <module>
     18 from bokeh.layouts import WidgetBox, Row, Column
     19 from bokeh.models import tools
---> 20 from bokeh.models import Model, ToolbarBox, FactorRange, Range1d, Plot, Spacer, CustomJS, GridBox
     21 from bokeh.models.widgets import DataTable, Tabs, Div
     22 from bokeh.plotting import Figure

ImportError: cannot import name 'GridBox' from 'bokeh.models', GridBox
     21 from bokeh.models.widgets import DataTable, Tabs, Div
     22 from bokeh.plotting import Figure

ImportError: cannot import name 'GridBox' from 'bokeh.models'

The error disappears after downgrading to holoviews version 1.11.3

philippjfr commented 5 years ago

Have you updated bokeh?

philippjfr commented 5 years ago

I think this is an issue with the conda-forge build actually. The pinning was set up wrong there will be a new build up later.

mdk73 commented 5 years ago

Bokeh is version 1.1.0

philippjfr commented 5 years ago

You sure you restarted your kernel:

from bokeh.models import Model, ToolbarBox, FactorRange, Range1d, Plot, Spacer, CustomJS, GridBox

works just fine for me with bokeh 1.1.0.

mdk73 commented 5 years ago
from bokeh.models import Model, ToolbarBox, FactorRange, Range1d, Plot, Spacer, CustomJS, GridBox
ImportError                               Traceback (most recent call last)
<ipython-input-1-f52fc2087b42> in <module>
----> 1 from bokeh.models import Model, ToolbarBox, FactorRange, Range1d, Plot, Spacer, CustomJS, GridBox

ImportError: cannot import name 'GridBox' from 'bokeh.models' 
import bokeh
bokeh.__version__

1.0.2

It looks like version 1.1.0 is installed, at least if I query with pip list, but the imported version is different.

Very weird, I guess I have to clean up my installation and probably do a fresh setup...

mdk73 commented 5 years ago

Sorry, I am not able to install bokeh 1.1.0 and hvplot 0.4.0 at the same time.

I started with a fresh miniconda environment, updated all packages, installed bokeh 1.1.0 and jupyter. Then I tried to install pandas and hvplot, and got the information that bokeh will be downgraded.

Here is the conda in- and output of the last step:


(base) C:\WINDOWS\system32>conda install pandas hvplot
WARNING: The conda.compat module is deprecated and will be removed in a future release.
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: C:\ProgramData\Miniconda3

  added / updated specs:
    - hvplot
    - pandas

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    bokeh-1.0.4                |           py37_0         5.4 MB
    cycler-0.10.0              |           py37_0          13 KB
    holoviews-1.12.1           |             py_0         3.3 MB
    hvplot-0.4.0               |             py_0         2.2 MB
    ipython-7.1.1              |   py37h39e3cac_0         1.1 MB
    kiwisolver-1.0.1           |   py37h6538335_0          61 KB
    matplotlib-3.0.3           |   py37hc8f65d3_0         6.6 MB
    pandas-0.24.2              |   py37ha925a31_0         9.6 MB
    param-1.8.2                |             py_0          60 KB
    pytz-2018.9                |           py37_0         264 KB
    pyviz_comms-0.7.0          |           py37_0          17 KB
    ------------------------------------------------------------
                                           Total:        28.6 MB

The following NEW packages will be INSTALLED:

  cycler             pkgs/main/win-64::cycler-0.10.0-py37_0
  holoviews          pkgs/main/noarch::holoviews-1.12.1-py_0
  hvplot             pkgs/main/noarch::hvplot-0.4.0-py_0
  kiwisolver         pkgs/main/win-64::kiwisolver-1.0.1-py37h6538335_0
  matplotlib         pkgs/main/win-64::matplotlib-3.0.3-py37hc8f65d3_0
  pandas             pkgs/main/win-64::pandas-0.24.2-py37ha925a31_0
  param              pkgs/main/noarch::param-1.8.2-py_0
  pytz               pkgs/main/win-64::pytz-2018.9-py37_0
  pyviz_comms        pkgs/main/win-64::pyviz_comms-0.7.0-py37_0

The following packages will be DOWNGRADED:

  bokeh                                        1.1.0-py37_0 --> 1.0.4-py37_0
  ipython                              7.4.0-py37h39e3cac_0 --> 7.1.1-py37h39e3cac_0

Proceed ([y]/n)? y

Downloading and Extracting Packages
matplotlib-3.0.3     | 6.6 MB    | #################################### | 100%
pyviz_comms-0.7.0    | 17 KB     | #################################### | 100%
kiwisolver-1.0.1     | 61 KB     | #################################### | 100%
cycler-0.10.0        | 13 KB     | #################################### | 100%
ipython-7.1.1        | 1.1 MB    | #################################### | 100%
param-1.8.2          | 60 KB     | #################################### | 100%
pytz-2018.9          | 264 KB    | #################################### | 100%
hvplot-0.4.0         | 2.2 MB    | #################################### | 100%
pandas-0.24.2        | 9.6 MB    | #################################### | 100%
bokeh-1.0.4          | 5.4 MB    | #################################### | 100%
holoviews-1.12.1     | 3.3 MB    | #################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(base) C:\WINDOWS\system32>
mdk73 commented 5 years ago

For now: conda install holoviews=1.11 solves my problem.