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)
The package causing the incompatibility is the notebook python package. The version of this package provided by Canopy/EDM is 4.4.1. Updating this package will alleviate the problem, however, since this package is integral to the IPython/Jupyter ecosystem, it has a complex reverse-dependency tree. For the time being we are not able to provide an updated version of notebook until other dependency updates are tested.
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
If using an old version of bokeh is not feasible, the following workaround can be used to create a new Canopy/EDM python environment with an updated version of the notebook library:
edm install -e test-bokeh --version 3.6 bokeh jupyter edm shell -e test-bokeh pip install --no-deps notebook==5.0.0
After the installation has finished, notebooks can be run using the newly created python environment from the command line by executing:
edm shell -e test-bokeh jupyter notebook /path/to/notebook_file.ipynb
Comments