Bokeh plots don't show up in Jupyter Notebook

Symptom:

Running a Jupyter notebook that uses bokeh for data visualization will execute with no errors, however, the plots will not be displayed.

 

Cause:

There is an incompatibility between the current version of bokeh provided by Canopy/EDM (0.12.9) and the current versions of the IPython/Jupyter/notebook ecosystem provided by Canopy/EDM. This issue persists even if bokeh is updated to 0.12.14 (the most recent version available via pip)

 

Solution(s):

The quick method of addressing this issue is to downgrade bokeh to 0.12.5. The combination of bokeh 0.12.5 and the current versions of the IPython/Jupyter/notebook ecosystem provided by Canopy/EDM work correctly.

Note: For those users working with bokeh and Jupyter notebooks, it may be beneficial to use a separate python environment for your bokeh work. This will better help to avoid problems with Canopy/EDM updating your version of bokeh back to an incompatible version whenever you want to update a set of packages.

 

Canopy/EDM users can easily create a separate python environment with the specific older bokeh version as follows:

Note: All of the following commands should be entered from a Canopy terminal (Tools menu => Canopy Terminal or Canopy Command Prompt) for Canopy users

First create a separate env for your bokeh projects:

edm environments create env_name --version python_version

# for example to create a python 2.7 env called my_bokeh_env:

edm environments create my_bokeh_env --version 2.7

 

Next, install bokeh with the specific version number, along with the Jupyter and any other packages you may need

edm shell -e my_bokeh_env
edm install bokeh==0.12.5 jupyter numpy pandas etc.....

 

Now you should be able to run your Jupyter notebooks from this python environment as follows:

edm shell -e my_bokeh_env
jupyter notebook my_notebook.ipynb

 

 

 

Have more questions? Submit a request

Comments

Powered by Zendesk