user1251007
user1251007

Reputation: 16721

AttributeError: 'module' object has no attribute 'plotting'

I am trying to generate a plot with bokeh in the following way:

import bokeh
p = bokeh.plotting.figure()
# ...

However, this results in an error:

AttributeError: 'module' object has no attribute 'plotting'

How can I fix this?

Upvotes: 2

Views: 4807

Answers (1)

user1251007
user1251007

Reputation: 16721

You need to import bokeh.plotting directly. The following way works:

import bokeh.plotting as bk
p = bk.figure()

Alternatively, you could import all plotting functions into the namespace directly and use it like this:

from bokeh.plotting import *
p = figure()

Upvotes: 4

Related Questions