0

Getting same error for below all three line, please help me to import Bar from bokeh library. I spent almost 3 hours but no solution.

-> from bokeh.plotting import Bar
-> from bokeh.io import Bar
-> from bokeh.charts import Bar

   ImportError: cannot import name 'Bar'
freak7
  • 99
  • 12

1 Answers1

1

The module bokeh.charts for long time has been removed and deprecated. Use bokeh.plotting instead. Try this. Let me know if it works.

from bokeh.plotting import figure, show

region = ["Global", "Asia", "Europe", "Latin America"]
volume = [3010, 1642, 716, 844]

p = figure(x_range=region)
p.vbar(x=region, top=volume, width=0.9)

show(p)
MEdwin
  • 2,940
  • 1
  • 14
  • 27