0% found this document useful (0 votes)
126 views8 pages

Jupyter Notebook Kernels - How To Add, Change, Remove

The document discusses how to configure Jupyter Notebook kernels to add different programming languages and environments. It provides instructions to add Python virtual environments, Apache Spark, Scala, and how to list, remove, and rename existing kernels.

Uploaded by

you 'n me
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views8 pages

Jupyter Notebook Kernels - How To Add, Change, Remove

The document discusses how to configure Jupyter Notebook kernels to add different programming languages and environments. It provides instructions to add Python virtual environments, Apache Spark, Scala, and how to list, remove, and rename existing kernels.

Uploaded by

you 'n me
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

NAVIGATION

Jupyter Notebook Kernels:


How to Add, Change, Remove
Last updated: 08 Aug 2020

Table of Contents
Add Virtualenv as Python Kernel
Add Apache Spark Kernel
Add Scala Kernel
List kernels
Remove kernel
Change Kernel name

» Examples were run on Ubuntu Linux


«
Add Virtualenv as Python Kernel
» Replace your-venv with your virtualenv name
«
Activate the virtualenv

$ source your-venv/bin/activate

Install jupyter in the virtualenv

(your-venv)$ pip install jupyter

Add the virtualenv as a jupyter kernel

(your-venv)$ ipython kernel install --name "local-venv" --user


/
You can now select the created kernel your-env when you start Jupyter
NAVIGATION

Add Apache Spark Kernel


»
«
Prerequisites: Java and a local Spark installation
(https://spark.apache.org/downloads.html)

Use a Jupyter plugin called Apache Toree.

Install the plugin into jupyter (replace Spark path with your installation
directory):

$ pip install jupyter


$ pip install --upgrade toree
$ jupyter toree install --user --spark_home=/home/felipe/Download
$ jupyter notebook

/
NAVIGATION

Start jupyter with the toree plugin


and you'll be able to link jupyter to
an existing local spark installation

Add Scala Kernel


»
«
The following steps are a summarized form of the content on this page
(https://almond.sh/docs/quick-start-install)

Example: install Scala 2.12.8 kernel with almond version 0.7.0:

Download almond and scala libs

(coursier is a scala tool used to install almond)

$ curl -Lo coursier https://git.io/coursier-cli (https://git.io/

(replace scala and almond versions if you need to)

/
$ ./coursier bootstrap \
NAVIGATION
-r jitpack \
-i user -I user:sh.almond:scala-kernel-api_2.12.8:0.7.0 \
sh.almond:scala-kernel_2.12.8:0.7.0 \
-o almond

Install Scala kernel in Jupyter

$ ./almond --install --id scala_2_12_8 --display-name "Scala 2

Open Jupyter notebook and select Scala kernel

Create Scala notebooks just as you


would python ones

/
NAVIGATION

List kernels
Use jupyter kernelspec list

$ jupyter kernelspec list


Available kernels:
global-tf-python-3 /home/felipe/.local/share/jupyter/kernels/
local_venv2 /home/felipe/.local/share/jupyter/kernels/
python2 /home/felipe/.local/share/jupyter/kernels/
python36 /home/felipe/.local/share/jupyter/kernels/
scala /home/felipe/.local/share/jupyter/kernels/

Remove kernel
Use jupyter kernelspec remove <kernel-name>

$ jupyter kernelspec remove old_kernel


Kernel specs to remove:
old_kernel /home/felipe/.local/share/jupyter/kernels/
Remove 1 kernel specs [y/N]: y
[RemoveKernelSpec] Removed /home/felipe/.local/share/jupyter/kerne

Change Kernel name /


1) Use $ jupyter kernelspec list to see the folder the kernel is located
NAVIGATION
in

2) In that folder, open up le kernel.json and edit option


"display_name"

Felipe ()  28 Jul 2019  08 Aug 2020 jupyter-notebooks (/tag/jupyter-


notebooks) scala (/tag/scala) spark (/tag/spark)

« Paper Summary: Sequence to Sequence Learning with Neural Networks


(/entries/paper-summary-sequence-to-sequence-learning-with-neural-
networks)

Archive (/archive)

Spark Dataframe Examples: Pivot and Unpivot Data » (/entries/spark-


dataframe-examples-pivot-and-unpivot-data)

Related content

/
NAVIGATION

CONTROLLINO - Jupyter Free IT Training Connect to


PLC compatible Notebook Jupyter
with Arduino Kernels: How to… Notebook…
Ad controllino.com queirozf.com Ad Connect Soft Limited queirozf.com

Unblock Disabling SSH Comparing Interactive


Censorship Timeout When Interactive controls for
Filters Connecting to/… Solutions for… Jupyter…
Ad FreeVPN queirozf.com queirozf.com queirozf.com

Dialogue & Discussion


0 Comments queirozf 🔒 Disqus' Privacy Policy 
1 Login

 Recommend 3 t Tweet f Share Sort by Best

Start the discussion…

LOG IN WITH
OR SIGN UP WITH DISQUS ?

Name

Be the first to comment.

✉ Subscribe d Add Disqus to your siteAdd DisqusAdd ⚠ Do Not Sell My Data

ABOUT THIS SITE


Technology reference and information archive. More › (/about)
/
OTHER NAVIGATION
()
Contact (/contact)
Atom Feed (/atom.xml)
sitemap.xml (/sitemap.xml)

CREDITS
()
Theme by Phlow (http://phlow.de/)
Favicon by Webalys (https://www.icon nder.com/webalys)

Created with JEKYLL (HTTP://JEKYLLRB.COM/).

  
(http://github.com/queirozfcom)
(https://www.linkedin.com/in/felipeqbalmeida)
(http://www.slideshare.net/queirozfcom)

You might also like