Need Help with Bokeh Error- AttributeError: module 'bokeh.plotting' has no attribute 'show'

Hey everyone,

I’m pretty new to using Bokeh and I’ve run into an issue I can’t seem to solve. I’m trying to create a simple plot, but I keep getting this error:

AttributeError: module ‘bokeh.plotting’ has no attribute ‘show’

Here’s a snippet of my code:

from bokeh.plotting import figure, show

p = figure(title="Simple Line Example")
p.line([1, 2, 3, 4, 5], [6, 7, 8, 9, 10], legend_label="Temp.", line_width=2)

show(p)

I’ve already installed Bokeh using pip install bokeh, so I’m not sure what the problem is. When I was searching about the error, I came across these resources/articles Installing bokeh. Error message 'module' object has no attribute 'version' how to learn python and as per them I tried the following

I check imports as I am importing show and figure correctly from bokeh.plotting. And it’s something look like this:

from bokeh.plotting import figure, show

I also updated Bokeh.

But still I am getting the same error.

Has anyone else run into this issue? Any ideas on how to fix it?

Thanks in advance for your help :pray:

Cheers,
Auro

I can’t think of any reason this could happen except that your Python install has some other serious issues more generally. What version of Bokeh are you using? (please: always specify relevant version information for any help request) What is the output of running print(bokeh.plotting)?

In [1]: import bokeh.plotting

In [2]: print(bokeh.plotting)
<module 'bokeh.plotting' from '/Users/bryan/anaconda3/envs/bk34-py312/lib/python3.12/site-packages/bokeh/plotting/__init__.py'>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.