How to use bokeh interactive visualization library in Jupyter Notebook?


#1

I installed bokeh interactive visualization library and when I try to use the library from bokeh.plotting import figure I get a lot of errors. Is there a way to use this library for plotting figures in Jupyter Notebook?


#2

Hi,

I reproduced the issue and have to investigate more to understand why it is not working.
To fix it you need to restart the ipython kernel and after it is possible to import.
I think the issue is that your current ipython kernel process already has some version of tornado library loaded. Then when you install bokeh tornado is updated as well but to reload it you need to restart the kernel.

Yury


#3

Hi,
I restarted the ipython kernel but I still cannot import. It happens the same also with plotly (another visualization library).

Carmen


#4

I created an example here
https://collab.humanbrainproject.eu/#/collab/509/nav/4946

I tested it with other people and it works as well for them (do first cell with pip2 install and then restart the kernel)
maybe you used pip instead of pip2

Yury


#5

Ok. Now it works importing. What about a single selection widget using bokeh?

from bokeh.models.widgets import Select
from bokeh.io import output_file, show, vform

output_file(“select.html”)

select = Select(title=“Option:”, value=“foo”, options=[“foo”, “bar”, “baz”, “quux”])

show(vform(select))

This works for you? I cannot see the form.


#6

I added it to the same example and it is working


#7

In my jupyter notebook is not working and I tried running it from your jupyter notebook example and it is not working anymore…


#8

some kind of details will be helpful
What exactly is not working? What error message do you see?


#9

I do not have errors. I simply can’t see the widget when I run the code…


#10

I don’t know bokeh library so it is difficult to help
Do you have this code in your notebook

from bokeh.io import output_notebook
output_notebook()

Can you send me link to your notebook?


#11

Ok. If I add the code that you suggested it works. Thank you!