This is an automated email from the ASF dual-hosted git repository. zjffdu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push: new 490396c [ZEPPELIN-4498]. Add document for jupyter interpreter 490396c is described below commit 490396cc237f60b83b0f78416461181c2aa9ce70 Author: Jeff Zhang <zjf...@apache.org> AuthorDate: Tue Jan 7 23:11:22 2020 +0800 [ZEPPELIN-4498]. Add document for jupyter interpreter ### What is this PR for? This PR add document for how to use jupyter interpreter in Zeppelin, we mainly talk about 3 kernels: * ipython * ir * julia ### What type of PR is it? [Documentation] ### Todos * [ ] - Task ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-4498 ### How should this be tested? * No test needed ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Jeff Zhang <zjf...@apache.org> Closes #3600 from zjffdu/ZEPPELIN-4498 and squashes the following commits: 21224bea8 [Jeff Zhang] [ZEPPELIN-4498]. Add document for jupyter interpreter --- docs/_includes/themes/zeppelin/_navigation.html | 1 + .../zeppelin/img/docs-img/ipython_kernel.png | Bin 0 -> 134015 bytes .../themes/zeppelin/img/docs-img/ir_kernel.png | Bin 0 -> 206755 bytes .../themes/zeppelin/img/docs-img/julia_kernel.png | Bin 0 -> 284921 bytes docs/interpreter/jupyter.md | 134 +++++++++++++++++++++ 5 files changed, 135 insertions(+) diff --git a/docs/_includes/themes/zeppelin/_navigation.html b/docs/_includes/themes/zeppelin/_navigation.html index 68252ef..a1796e7 100644 --- a/docs/_includes/themes/zeppelin/_navigation.html +++ b/docs/_includes/themes/zeppelin/_navigation.html @@ -142,6 +142,7 @@ <li><a href="{{BASE_PATH}}/interpreter/hive.html">Hive</a></li> <li><a href="{{BASE_PATH}}/interpreter/ignite.html">Ignite</a></li> <li><a href="{{BASE_PATH}}/interpreter/java.html">Java</a></li> + <li><a href="{{BASE_PATH}}/interpreter/jupyter.html">Jupyter</a></li> <li><a href="{{BASE_PATH}}/interpreter/kotlin.html">Kotlin</a></li> <li><a href="{{BASE_PATH}}/interpreter/kylin.html">Kylin</a></li> <li><a href="{{BASE_PATH}}/interpreter/lens.html">Lens</a></li> diff --git a/docs/assets/themes/zeppelin/img/docs-img/ipython_kernel.png b/docs/assets/themes/zeppelin/img/docs-img/ipython_kernel.png new file mode 100644 index 0000000..eefe97e Binary files /dev/null and b/docs/assets/themes/zeppelin/img/docs-img/ipython_kernel.png differ diff --git a/docs/assets/themes/zeppelin/img/docs-img/ir_kernel.png b/docs/assets/themes/zeppelin/img/docs-img/ir_kernel.png new file mode 100644 index 0000000..a1bf5ec Binary files /dev/null and b/docs/assets/themes/zeppelin/img/docs-img/ir_kernel.png differ diff --git a/docs/assets/themes/zeppelin/img/docs-img/julia_kernel.png b/docs/assets/themes/zeppelin/img/docs-img/julia_kernel.png new file mode 100644 index 0000000..5c075dc Binary files /dev/null and b/docs/assets/themes/zeppelin/img/docs-img/julia_kernel.png differ diff --git a/docs/interpreter/jupyter.md b/docs/interpreter/jupyter.md new file mode 100644 index 0000000..89586e6 --- /dev/null +++ b/docs/interpreter/jupyter.md @@ -0,0 +1,134 @@ +--- +layout: page +title: "Jupyter Interpreter for Apache Zeppelin" +description: "Project Jupyter exists to develop open-source software, open-standards, and services for interactive computing across dozens of programming languages." +group: interpreter +--- +<!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> +{% include JB/setup %} + +# Jupyter Interpreter for Apache Zeppelin + +<div id="toc"></div> + +## Overview + +Project [Jupyter](https://jupyter.org/) exists to develop open-source software, open-standards, and services for interactive computing across dozens of programming languages. +Zeppelin's Jupyter interpreter is a bridge/adapter between Zeppelin interpreter and Jupyter kernel. You can use any of jupyter kernel as long as you installed the necessary dependencies. + +## Configuration + +To run any Jupyter kernel in Zeppelin you first need to install the following prerequisite: + +* pip install jupyter-client +* pip install grpcio +* pip install protobuf + +Then you need install the jupyter kernel you want to use. In the following sections, we will talk about how to use the following 3 jupyter kernels in Zeppelin: + +* ipython +* ir +* julia + +## Jupyter Python kernel + +In order to use Jupyter Python kernel in Zeppelin, you need to install `ipykernel` first. + +```bash + +pip install ipykernel +``` + +Then you can run python code in Jupyter interpreter like following. + +```python + +%jupyter(kernel=python) + +%matplotlib inline +import matplotlib.pyplot as plt +plt.plot([1, 2, 3]) +``` + +<img class="img-responsive" src="{{BASE_PATH}}/assets/themes/zeppelin/img/docs-img/ipython_kernel.png" width="80%"/> + +## Jupyter R kernel + +In order to use [IRKernel](https://github.com/IRkernel/IRkernel), you need to first install `IRkernel` package in R. + +```r +install.packages('IRkernel') +IRkernel::installspec() # to register the kernel in the current R installation +``` + +Then you can run r code in Jupyter interpreter like following. + +```r +%jupyter(kernel=ir) + +library(ggplot2) +ggplot(mpg, aes(x = displ, y = hwy)) + + geom_point() +``` + +<img class="img-responsive" src="{{BASE_PATH}}/assets/themes/zeppelin/img/docs-img/ir_kernel.png" width="80%"/> + + +## Jupyter Julia kernel + +In order to use Julia in Zeppelin, you first need to install [IJulia](https://github.com/JuliaLang/IJulia.jl) first + +```julia +using Pkg +Pkg.add("IJulia") + +``` + +Then you can run julia code in Jupyter interpreter like following. + +```julia + +%jupyter(kernel=julia-1.3) + +using Pkg +Pkg.add("Plots") +using Plots +plotly() # Choose the Plotly.jl backend for web interactivity +plot(rand(5,5),linewidth=2,title="My Plot") +Pkg.add("PyPlot") # Install a different backend +pyplot() # Switch to using the PyPlot.jl backend +plot(rand(5,5),linewidth=2,title="My Plot") +``` + +<img class="img-responsive" src="{{BASE_PATH}}/assets/themes/zeppelin/img/docs-img/julia_kernel.png" width="80%"/> + + +## Use any other kernel + +For any other jupyter kernel, you can follow the below steps to use it in Zeppelin. + +1. Install the specified jupyter kernel. you can find all the available jupyter kernels [here](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels) +2. Find its kernel name by run the following command + ```bash + jupyter kernelspec list + ``` +3. Run the kernel as following + +```python + +%jupyter(kernel=kernel_name) + +code +``` \ No newline at end of file