Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: HoloViews bokeh backend could not be imported #2012

Closed
rr5577 opened this issue Oct 22, 2017 · 18 comments
Closed

Error: HoloViews bokeh backend could not be imported #2012

rr5577 opened this issue Oct 22, 2017 · 18 comments

Comments

@rr5577
Copy link

rr5577 commented Oct 22, 2017

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?

@philippjfr
Copy link
Member

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 #2005 for more detail.

@rr5577
Copy link
Author

rr5577 commented Oct 22, 2017

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

@philippjfr
Copy link
Member

No problem at all. Easy to miss issues.

@rstuckey
Copy link

rstuckey commented Mar 5, 2018

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.

@philippjfr
Copy link
Member

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

@rstuckey
Copy link

rstuckey commented Mar 6, 2018

Yes, that did the trick. Thanks so much.

@junaidahmed361
Copy link

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.

@philippjfr
Copy link
Member

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

@junaidahmed361
Copy link

junaidahmed361 commented May 2, 2018

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'.

@aagentile
Copy link

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!

@philippjfr
Copy link
Member

@aagentile Upgrade bokeh to at least 0.12.15.

@jrhayward
Copy link

jrhayward commented Apr 4, 2019

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

@jrhayward
Copy link

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.

@guyts
Copy link

guyts commented Sep 18, 2019

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).

@philippjfr
Copy link
Member

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.

@guyts
Copy link

guyts commented Sep 18, 2019

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

@Oye-G
Copy link

Oye-G commented Feb 24, 2020

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

@dycw
Copy link

dycw commented Mar 10, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants