2

I'm trying to change the coordinate reference system crs to a tile provider in bokeh and I was suggested to use geoviews but after install it I get this error

import geoviews as gv
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/geoviews/__init__.py", line 3, in <module>
    from holoviews import (extension, help, opts, output, renderer, Store, # noqa (API import)
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/holoviews/__init__.py", line 12, in <module>
    from .annotators import annotate                         # noqa (API import)
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/holoviews/annotators.py", line 10, in <module>
    from panel.pane import PaneBase
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/panel/__init__.py", line 3, in <module>
    from . import layout # noqa
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/panel/layout/__init__.py", line 1, in <module>
    from .accordion import Accordion # noqa
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/panel/layout/accordion.py", line 5, in <module>
    from .base import NamedListPanel
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/panel/layout/base.py", line 13, in <module>
    from ..io.model import hold
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/panel/io/__init__.py", line 8, in <module>
    from ..config import config
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/panel/config.py", line 20, in <module>
    from .io.notebook import load_notebook
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/panel/io/notebook.py", line 40, in <module>
    from .embed import embed_state
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/panel/io/embed.py", line 20, in <module>
    from .model import add_to_doc, diff
  File "/home/kevin1/anaconda3/lib/python3.9/site-packages/panel/io/model.py", line 11, in <module>
    from bokeh.models import Box, ColumnDataSource, Model
ImportError: cannot import name 'Box' from 'bokeh.models' (/home/kevin1/anaconda3/lib/python3.9/site-packages/bokeh/models/__init__.py)

I've install HoloViews and reinstall bokeh conda install -c bokeh bokeh conda install -c "bokeh/label/dev" bokeh but nothing

Peter
  • 21
  • 1
  • 3
  • Usually this means bokeh isn't installed in the same environment as you are running, or has the wrong version. Try "import bokeh", and if that fails, install a compatible version of bokeh. If it succeeds, check `bokeh.__version__`; it presumably won't be a version compatible with your installed version of Panel. – Caridorc Feb 13 '23 at 01:07
  • At the moment `panel` is not compatible with the lateset version of `bokeh`. This is an issue with work in progress. See [isse #4097](https://github.com/holoviz/panel/issues/4097). – mosc9575 Apr 02 '23 at 19:57

1 Answers1

3

I got this error because I had installed jupyter_bokeh. Trying to re-install regular bokeh didn't fix it. Upgrading bokeh didn't help.

Seems to be that HoloViews relies on Panel which requires bokeh < 2.5.0, >= 2.4.0. The warning I got from pip read:

panel 0.14.4 requires bokeh<2.5.0,>=2.4.0, but you have bokeh 3.1.0 which is incompatible.

So, downgrading to bokeh==2.4.0 solved the problem for me.

sh37211
  • 1,411
  • 1
  • 17
  • 39