How can I use Bokeh in an Azure ML notebook
<p>I can run the following code in a Jupyter notebook (Python 3.5) on my PC using Anaconda, and it works fine. But when I run the same code in an Azure ML notebook, I get the plot, but also the error message described below. Does anyone know how to use Bokeh in Azure ML notebooks ? Is there perhaps a way to import the seemingly missing module 'ipykernel'</p>

<pre><code>from bokeh.plotting import figure, show, output_notebook
from bokeh.sampledata.iris import flowers

colormap = {'setosa': 'red', 'versicolor': 'green', 'virginica': 'blue'}
colors = [colormap[x] for x in flowers['species']]

p = figure(title = "Iris Morphology")
p.xaxis.axis_label = 'Petal Length'
p.yaxis.axis_label = 'Petal Width'

p.circle(flowers["petal_length"], flowers["petal_width"],
     color=colors, fill_alpha=0.2, size=10)

output_notebook()
show(p)
</code></pre>

<p>produces the plot, but also the following errors</p>

<pre><code>---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
&lt;ipython-input-17-c50d1a94007e&gt; in &lt;module&gt;()
 13 
 14 output_notebook()
---&gt; 15 show(p)

/home/nbuser/env3/lib/python3.4/site-packages/bokeh/io.py in show(obj,        browser, new)
    299 
    300     '''
--&gt; 301     return _show_with_state(obj, _state, browser, new)
    302 
    303 def _show_with_state(obj, state, browser, new):

/home/nbuser/env3/lib/python3.4/site-packages/bokeh/io.py in     _show_with_state(obj, state, browser, new)
    307 
    308     if state.notebook:
--&gt; 309         comms_handle = _show_notebook_with_state(obj, state)
    310 
    311     elif state.server_enabled:

/home/nbuser/env3/lib/python3.4/site-packages/bokeh/io.py in     _show_notebook_with_state(obj, state)
    329         comms_target = make_id()
    330         publish_display_data({'text/html': notebook_div(obj,   comms_target)})
--&gt; 331         handle = _CommsHandle(get_comms(comms_target), state.document,     state.document.to_json())
    332         state.last_comms_handle = handle
    333         return handle

/home/nbuser/env3/lib/python3.4/site-packages/bokeh/util/notebook.py in   get_comms(target_name)
    109 
    110     '''
--&gt; 111     from ipykernel.comm import Comm 
    112     return Comm(target_name=target_name, data={})
    113 

ImportError: No module named 'ipykernel'

In [16]:
</code></pre>

<p>â</p>

<p>There are two options I think. In a notebook, I think you can use <code>conda</code> to install new packages in your AzureML environment, by executing a cell with the following:</p>

<pre><code>!conda install ipykernel --yes
</code></pre>

<p>Note the <code>!</code> at the beginning. In Jupyter notebooks that means to execute the command as a shell command. </p>

<p>Althernatively, in the upcoming <code>0.12.2</code> release later this week <em>(today's date: 2016-08-28)</em> the "notebook comms" feature that uses <code>ipykernel</code> to be imported will no longer be "turned on" all the time, and will only be used when explicitly asked for. That should also resolve this problem.</p>

<p>Until <code>0.12.2</code> is released, you can use these new features by installing a "dev build" or release candidate. The main docs site has simple instructions for <a href="http://bokeh.pydata.org/en/dev/docs/installation.html#developer-builds" rel="nofollow">installing developer builds</a>. (You can install similarly using <code>!conda</code> in a notebook, as above.)</p>

python azure jupyter-notebook bokeh azure-ml