Bokeh extension HoloViews 1.15.4 fails to import

I am trying to build a rudimentary web application involving Bokeh plots in JupyterLab.

In order to make this code in the HoloViews documentation work (and not throw WARNING:param.RectanglesPlot01428: Tool of type 'box_edit' could not be found and could not be activated by default.), I tried this fix and downgraded to 1.15.4. Unfortunately, this created a different problem.

I used the following Conda environment on a Windows computer:

name: boxStream
channels:
  - conda-forge
  - defaults
  - fastai
dependencies:
  - jupyterlab
  - holoviews<=1.15.4
  - panel>=0.12.7
  - bokeh
  - ipywidgets
  - numpy
  - nbdev=2.3.12
  - fastcore=1.5.28 

I ran a cell with import statements and the Bokeh option:

#| export
import holoviews as hv
from holoviews import opts
from holoviews import streams

hv.extension('bokeh')

This gave the following error:



WARNING:param.notebook_extension: Holoviews bokeh extension could not be imported, it raised the following exception: ModuleNotFoundError('No module named 'bokeh.models.arrow_heads'')

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 6
      3 from holoviews import opts
      4 from holoviews import streams
----> 6 hv.extension('bokeh')

File ~/anaconda3/envs/boxStream/lib/python3.11/site-packages/pyviz_comms/__init__.py:64, in extension.__new__(cls, *args, **kwargs)
     62 except Exception:
     63     pass
---> 64 return param.ParameterizedFunction.__new__(cls, *args, **kwargs)

File ~/anaconda3/envs/boxStream/lib/python3.11/site-packages/param/parameterized.py:3658, in ParameterizedFunction.__new__(class_, *args, **params)
   3656 inst = class_.instance()
   3657 inst.param._set_name(class_.__name__)
-> 3658 return inst.__call__(*args,**params)

File ~/anaconda3/envs/boxStream/lib/python3.11/site-packages/holoviews/ipython/__init__.py:116, in notebook_extension.__call__(self, *args, **params)
    114 def __call__(self, *args, **params):
    115     comms = params.pop('comms', None)
--> 116     super().__call__(*args, **params)
    117     # Abort if IPython not found
    118     try:

File ~/anaconda3/envs/boxStream/lib/python3.11/site-packages/holoviews/util/__init__.py:702, in extension.__call__(self, *args, **params)
    697             self.param.warning('%s backend hook %s failed with '
    698                                'following exception: %s' %
    699                                (backend, hook, e))
    701 if selected_backend is None:
--> 702     raise ImportError('None of the backends could be imported')
    703 Store.set_current_backend(selected_backend)

ImportError: None of the backends could be imported

After I could find nothing on this topic and recognizing that there had been a Windows update very recently, I changed my operating system to Linux on a brand new SSD (a project I had been meaning to get around to anyways).

This made no difference and the error recurred. My manager was unable to reproduce this error on macOS but was able to reproduce the error in a Docker container.

This is a relatively undocumented error, but it is seemingly pervasive. Any help?

This is because of a numpy 1.25 (fixed in #5636).

Can you try to downgrade numpy=1.24 and see if that works? Sorry for the inconvenience.

So, I tried the downgrade to numpy=1.24. I tried it for numpy:

1.24.0
1.24.1
1.24.2
1.24.3
1.24.4

None of these downgrades worked. Thanks for the advice though!

Still working on fixing the bug. If it works out, then I’ll put out an update here on the fix.