Hi,
I try to use bokeh to work in jupyterLab, pyspark kernel but noting is displayed.
I deployed an AWS EMR with jupyterHub prepackaged by AWS.
I manually installed jupyterLab on it (JupyterLab on JupyterHub). and gew other llibraries
sudo python3 -m pip install ipython
sudo python3 -m pip install jupyterlab jupyterlab-git
sudo python3 -m pip install matplotlib==3.4.3
sudo python3 -m pip install seaborn
I manually installed Hail v0.2.80, that come with bokeh 1.4.0 as a requirement
few other environment versions for info:
- EMR: emr-6.4.0
- EC2: Amazon Linux 2 AMI
- Java: java -version 1.8.0
- Python: python --version 3.7.10
- Ganglia: 3.7.2
- Hadoop: hadoop version 3.2.1
- JupyterHub: 1.4.1
- Livy: ?
- Spark UI: 3.1.2
- Spark: spark-shell 3.1.2
- Scala: spark-shell 2.12.10
In jupyterLab, I open a new PySpark kernel.
I am able to initiate spark and load hail
I can load some data
I can display HTML styled spark dataframes using
%%pretty
data.to_spark().show()
I can display matplotlib plot using
import matplotlib.pyplot as plt
# Extract data
p_df = data.to_pandas()
# Compute histogram
plt.hist(p_df['info.AN'], bins=10, range=(4500, 5500))
# Use sparkmagic
%matplot plt
So it seams that diaplying HTML in pyspark is doable.
But I am not able to plot using bokeh
from bokeh.plotting import figure, show, output_notebook
output_notebook()
# prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# create a new plot with a title and axis labels
p = figure(title="Simple line example", x_axis_label="x", y_axis_label="y")
# add a line renderer with legend and line thickness
p.line(x, y, legend_label="Temp.", line_width=2)
# show the results
show(p)
The code above do not display anything (no loading bokeh…, no error)
I try to install jupyter-bokeh
but that upgrade bokeh to v2.4.2 (that is incompatible with Hail) and do not solve the ploting issue…
Please help