Holoviews: Error: HoloViews bokeh backend could not be imported

Created on 22 Oct 2017  路  18Comments  路  Source: holoviz/holoviews

Hi, I just tried to run the examples from the blogpost in jupyter lab. But i麓m getting an error right at the beginning:

import numpy as np
import xarray as xr
import pandas as pd
import holoviews as hv
import geoviews as gv
import iris
import cartopy

from cartopy import crs
from cartopy import feature as cf
from geoviews import feature as gf

hv.notebook_extension('bokeh','matplotlib')
%output backend='matplotlib'
%opts Feature [projection=crs.Robinson()]

WARNING:root:notebook_extension: HoloViews bokeh backend could not be imported, ensure bokeh is installed.

but i have installed it:

import bokeh
print("bokeh",bokeh.__version__)
print("holoviews",hv.__version__)
print("geoviews",gv.__version__)

bokeh 0.12.10
holoviews 1.8.4-x-gde78cf33a
geoviews 1.3.2

any ideas what icould be wrong?

Most helpful comment

As of today, bokeh releases include 2.0.0 and 1.4.0; the former did not work for me whilst the latter did.

All 18 comments

The recent bokeh release introduced some changes which are incompatible with 1.8.4. We will be releasing 1.9.0 asap, in the meantime you can downgrade to bokeh 0.12.9 or upgrade to holoviews 1.9.0dev3. See https://github.com/ioam/holoviews/issues/2005 for more detail.

looks like this was already mentioned and a workaround posted in #2005
should麓ve looked more diligently, sorry.

No problem at all. Easy to miss issues.

It seems this error has reappeared, for me at least.

import bokeh
import holoviews as hv
import sys
print("python:", sys.version)
print("bokeh:", bokeh.__version__)
print("holoviews:", hv.__version__)

python: 3.6.2 |Anaconda custom (64-bit)| (default, Jul 20 2017, 13:51:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
bokeh: 0.12.13
holoviews: 1.9.5-x-g39fe834be

hv.extension('bokeh')

WARNING:root:notebook_extension: Holoviews bokeh extension could not be imported, it raised the following exception: ImportError('cannot import name 'convert_datetime_array'')

ImportError Traceback (most recent call last)
in ()
----> 1 hv.extension('bokeh')

/opt/anaconda3/envs/fdenv0/lib/python3.6/site-packages/param/parameterized.py in __new__(class_, args, params)
1886 inst = class_.instance()
1887 inst._set_name(class_.__name__)
-> 1888 return inst.__call__(
args,params)
1889
1890 def __call__(self,args,*kw):

/opt/anaconda3/envs/fdenv0/lib/python3.6/site-packages/holoviews/ipython/__init__.py in __call__(self, args, *params)
104
105 def __call__(self, args, *params):
--> 106 super(notebook_extension, self).__call__(args, *params)
107 # Abort if IPython not found
108 try:

/opt/anaconda3/envs/fdenv0/lib/python3.6/site-packages/holoviews/util/__init__.py in __call__(self, args, *params)
334
335 if selected_backend is None:
--> 336 raise ImportError('None of the backends could be imported')
337 Store.current_backend = selected_backend
338

ImportError: None of the backends could be imported

Not sure where that "convert_datetime_array" is coming from, perhaps there a missing dependency? I installed via:

conda install -c conda-forge holoviews

Any help would be appreciated.

It seems that convert_datetime_array wasn't added to bokeh until the recent 0.12.14 release but we didn't pin that version in our 1.9.5 release. The easiest way to fix it will be to upgrade with:

conda install -c bokeh bokeh

Yes, that did the trick. Thanks so much.

Hi, I just tried to run holoviews with bokeh backend and got the same error, but different import issue.
WARNING:root:notebook_extension: Holoviews bokeh extension could not be imported, it raised the following exception: ImportError('cannot import name 'Selection'').

I installed via pip for both holoviews and bokeh, and am trying to use both in jupyter lab.

I installed via pip for both holoviews and bokeh, and am trying to use both in jupyter lab.

What version of holoviews and bokeh did you get?

import bokeh as bk
import holoviews as hv
print(bk.__version__, hv.__version__)

If you're using JupyterLab you'll also need the extensions, for holoviews:

jupyter labextension install @pyviz/jupyterlab_holoviews

and if you're plotting using bokeh directly also:

jupyter labextension install jupyterlab_bokeh

Upgraded both to newest versions as I saw the ones I was working with were outdated, plus reinstalled the extensions just in case. Now my bokeh version is 0.12.15 and holoviews version is 1.10.2.
But when I run the holoviews import again with bokeh and matplotlib imports, I get 'JavaScript output is disabled in JupyterLab'.

same problem as @junaidahmed361:
ImportError('cannot import name 'Selection'')

with:
bokeh 0.12.14
holoviews 1.10.3

It doesn't really matter the version(s) to adopt, at least to me, can you suggest a combination that DEFINITELY works at the moment? I will down/up grade accordingly!

@aagentile Upgrade bokeh to at least 0.12.15.

Getting similar problem and have, I believe, the latest versions of bokeh and holoviews

import numpy as np
import holoviews as hv
from holoviews import opts
hv.extension('bokeh')
WARNING:param.extension: Holoviews bokeh extension could not be imported, it raised the following exception: ImportError('cannot import name 'GridBox'')
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/param/parameterized.py", line 2727, in __new__
return inst.__call__(args,*params)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/holoviews/util/__init__.py", line 700, in __call__
raise ImportError('None of the backends could be imported')
ImportError: None of the backends could be imported

print("python:", sys.version)
python: 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]

print("bokeh:", bokeh.__version__)
bokeh: 1.0.4
print("holoviews:", hv.__version__)
holoviews: 1.12.0

I fixed this by un-installing everything and reinstalling using conda. I also did not realize that when something is installed with conda it is managed outside of the normal Python flow (used by PIP) and that I needed to run anaconda's version of Python.

I am going to retry using only pip3 installs and see if I can have it work that way as well.

I have just installed holoviews and bokeh using conda, and am experiencing the issues as mentioned above.
My installation was simply conda install -c pyviz holoviews bokeh as specified on HV docs.
When running hv.extension('bokeh') I'm getting the following error:

WARNING:param.notebook_extension: Holoviews bokeh extension could not be imported, it raised the following exception: SSLError('unknown error (_ssl.c:2994)')
Traceback (most recent call last):
..
ImportError: None of the backends could be imported

I tried solution mentioned above, but nothing worked in my case.
Running bokeh 1.0.4 and hv 1.11.0 on Windows 10, Py3.7 (Anaconda 2019.03).

Running bokeh 1.0.4 and hv 1.11.0 on Windows 10, Py3.7 (Anaconda 2019.03).

These are very old. The current versions are bokeh 1.13.4 and holoviews 1.12.5.

Updated bokeh and it worked.
Note - the bokeh version it 1.3.4.

Thanks. pip install bokeh==1.3.4 fixed it for me too.

As of today, bokeh releases include 2.0.0 and 1.4.0; the former did not work for me whilst the latter did.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mansenfranzen picture mansenfranzen  路  5Comments

asmith26 picture asmith26  路  4Comments

rabernat picture rabernat  路  6Comments

obust picture obust  路  5Comments

ahuang11 picture ahuang11  路  3Comments