Skip to main content
 首页 » 编程设计

python之全息图/ Bokeh 导入错误

2025年05月04日17jpfss

我在工作

In [2]: bokeh.__version__ 
Out[2]: '0.12.1' 
 
In [4]: holoviews.__version__ 
Out[4]: 1.8.4 

下面的导入

from holoviews.plotting.bokeh import BokehRenderer 

产生错误:

--------------------------------------------------------------------------- 
ImportError                               Traceback (most recent call last) 
<ipython-input-1-c53ae81a79e0> in <module>() 
----> 1 from holoviews.plotting.bokeh import BokehRenderer 
 
/usr/local/lib/python3.6/site-packages/holoviews/plotting/bokeh/__init__.py in <module>() 
      2  
      3 import numpy as np 
----> 4 from bokeh.palettes import all_palettes 
      5  
      6 from ...core import (Store, Overlay, NdOverlay, Layout, AdjointLayout, 
 
ImportError: cannot import name 'all_palettes' 

它以前有效,但我无法追踪发生了什么变化。

请您参考如下方法:

HoloViews 1.8.4 需要最新版本的 Bokeh ,建议 >=0.12.6。我建议升级:

conda install -c bokeh bokeh=0.12.9 

或

pip install bokeh