Nice!
Get this in 
https://github.com/apache/zeppelin/blob/master/docs/interpreter/python.md?

________________________________
From: Partridge, Lucas (GE Aviation) <lucas.partri...@ge.com>
Sent: Wednesday, January 10, 2018 2:27:19 AM
To: Jeff Zhang
Cc: users@zeppelin.apache.org
Subject: Use Bokeh in Apache Zeppelin

Thanks Jeff! I can confirm the following resulted in an inline graph when using 
a notebook bound to the Spark interpreter group in plain Zeppelin 0.7.0:

%pyspark
from bokeh.plotting import figure
from bokeh.io import show,output_notebook
import bkzep
output_notebook(notebook_type='zeppelin')

f = figure()
f.line(x=[1,2],y=[3,4])
show(f)

From: Jeff Zhang [mailto:zjf...@gmail.com]
Sent: 09 January 2018 23:24
To: Partridge, Lucas (GE Aviation) <lucas.partri...@ge.com>
Cc: users@zeppelin.apache.org
Subject: EXT: Re: Use Bokeh in Apache Zeppelin


Awesome. Glad to see you can use bokeh in zeppelin. From bokeh after 0.12.7, 
you need bkzep. You can check the README here. https://github.com/zjffdu/bkzep

Actually you just need to import bkzep. You don't need to call 
install_notebook_hook explicitly.



Partridge, Lucas (GE Aviation) 
<lucas.partri...@ge.com<mailto:lucas.partri...@ge.com>>于2018年1月10日周三 上午12:35写道:
Hi Jeff,

I eventually managed to get Bokeh running in Zeppelin 0.7.0 after finding your 
code at https://pypkg.com/pypi/bkzep/f/bkzep/__init__.py . So I did ‘pip 
install bkzep’ and restarted Zeppelin. Then if I pasted this code of yours…

from bokeh.io<http://bokeh.io> import install_notebook_hook
from bkzep.io<http://bkzep.io> import load_notebook, 
_show_zeppelin_app_with_state, _show_zeppelin_doc_with_state

install_notebook_hook('zeppelin', load_notebook,
                      _show_zeppelin_doc_with_state, 
_show_zeppelin_app_with_state, overwrite=True)

…into a notebook paragraph before using Bokeh then I could see my plots 
directly within Zeppelin:).
Thanks, Lucas.

From: Partridge, Lucas (GE Aviation)
Sent: 09 January 2018 15:01

To: users@zeppelin.apache.org<mailto:users@zeppelin.apache.org>
Cc: zjf...@gmail.com<mailto:zjf...@gmail.com>
Subject: EXT: RE: Use Bokeh in Apache Zeppelin

I forgot to say I’m using Bokeh 0.12.13.

From: Partridge, Lucas (GE Aviation)
Sent: 09 January 2018 13:24
To: users@zeppelin.apache.org<mailto:users@zeppelin.apache.org>
Cc: zjf...@gmail.com<mailto:zjf...@gmail.com>
Subject: EXT: RE: Use Bokeh in Apache Zeppelin

Hi Jeff,

Adding support for Bokeh in Zeppelin is great! At 
https://www.zepl.com/viewer/notebooks/bm90ZTovL3pqZmZkdS90ZXN0L2VhMGI0ODQ0MzNhYjQxNjZhODg5MjI1ZjAxZWVjMjdiL25vdGUuanNvbg
 it says:

“If you want to use bokeh in spark interpreter. You need HDP 2.6.0 (Zeppelin 
0.7.0) or afterwards”

I’m not using HDP but I am using Zeppelin 0.7.0 (zeppelin-0.7.0-bin-all.tgz) in 
ubuntu 16.04. And when I do this in a notebook bound to the Spark interpreter 
group:

%pyspark
from bokeh.io<http://bokeh.io> import output_notebook
output_notebook(notebook_type='zeppelin')

I get this error:

Traceback (most recent call last):
  File "/tmp/zeppelin_pyspark-8411751233295366188.py", line 346, in <module>
    raise Exception(traceback.format_exc())
Exception: Traceback (most recent call last):
  File "/tmp/zeppelin_pyspark-8411751233295366188.py", line 339, in <module>
    exec(code)
  File "<stdin>", line 2, in <module>
  File "/home/lucas/.local/lib/python2.7/site-packages/bokeh/util/api.py", line 
190, in wrapper
    return obj(*args, **kw)
  File "/home/lucas/.local/lib/python2.7/site-packages/bokeh/io/output.py", 
line 114, in output_notebook
    run_notebook_hook(notebook_type, 'load', resources, verbose, hide_banner, 
load_timeout)
  File "/home/lucas/.local/lib/python2.7/site-packages/bokeh/util/api.py", line 
190, in wrapper
    return obj(*args, **kw)
  File "/home/lucas/.local/lib/python2.7/site-packages/bokeh/io/notebook.py", 
line 286, in run_notebook_hook
    raise RuntimeError("no display hook installed for notebook type %r" % 
notebook_type)
RuntimeError: no display hook installed for notebook type 'zeppelin'

Can you confirm Bokeh does work with the %pyspark interpreter in Zeppelin 
0.7.0? Or should I move to a later version of Zeppelin? I’d rather stick with 
0.7.0 for now if possible.

Thanks, Lucas.

From: Jeff Zhang [mailto:zjf...@gmail.com]
Sent: 02 July 2017 00:01
To: users <users@zeppelin.apache.org<mailto:users@zeppelin.apache.org>>
Subject: EXT: Use Bokeh in Apache Zeppelin


I write a tutorial on using bokeh in apache zeppelin. If you are interested in 
data visualization in zeppelin notebook, bokeh would be a very good library for 
you. And you can take a look at the tutorial here.

https://community.hortonworks.com/articles/109837/use-bokeh-in-apache-zeppelin.html


Reply via email to