Jupyter Notebook
Jupyter Notebook
Release 7.0.0a5
https://jupyter.org
1 User Documentation 3
1.1 The Jupyter Notebook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 User interface components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Notebook Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 What to do when things go wrong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
1.5 Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2 Configuration 89
2.1 Configuration Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
2.2 Extending the Notebook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3 Contributor 91
3.1 Contributing to Jupyter Notebook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.2 Developer FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
i
ii
Jupyter Notebook Documentation, Release 7.0.0a5
• Installation
• Starting the Notebook
CONTENTS 1
Jupyter Notebook Documentation, Release 7.0.0a5
2 CONTENTS
CHAPTER
ONE
USER DOCUMENTATION
1.1.1 Introduction
The notebook extends the console-based approach to interactive computing in a qualitatively new direction, providing a
web-based application suitable for capturing the whole computation process: developing, documenting, and executing
code, as well as communicating the results. The Jupyter notebook combines two components:
A web application: a browser-based tool for interactive authoring of documents which combine explanatory text,
mathematics, computations and their rich media output.
Notebook documents: a representation of all content visible in the web application, including inputs and outputs of
the computations, explanatory text, mathematics, images, and rich media representations of objects.
See also:
See the installation guide on how to install the notebook and its dependencies.
• In-browser editing for code, with automatic syntax highlighting, indentation, and tab completion/introspection.
• The ability to execute code from the browser, with the results of computations attached to the code which gener-
ated them.
• Displaying the result of computation using rich media representations, such as HTML, LaTeX, PNG, SVG, etc.
For example, publication-quality figures rendered by the matplotlib library, can be included inline.
• In-browser editing for rich text using the Markdown markup language, which can provide commentary for the
code, is not limited to plain text.
• The ability to easily include mathematical notation within markdown cells using LaTeX, and rendered natively
by MathJax.
3
Jupyter Notebook Documentation, Release 7.0.0a5
Notebook documents
Notebook documents contains the inputs and outputs of a interactive session as well as additional text that accompanies
the code but is not meant for execution. In this way, notebook files can serve as a complete computational record of a
session, interleaving executable code with explanatory text, mathematics, and rich representations of resulting objects.
These documents are internally JSON files and are saved with the .ipynb extension. Since JSON is a plain text format,
they can be version-controlled and shared with colleagues.
Notebooks may be exported to a range of static formats, including HTML (for example, for blog posts), reStructured-
Text, LaTeX, PDF, and slide shows, via the nbconvert command.
Furthermore, any .ipynb notebook document available from a public URL can be shared via the Jupyter Notebook
Viewer <nbviewer>. This service loads the notebook document from the URL and renders it as a static web page.
The results may thus be shared with a colleague, or as a public blog post, without other users needing to install the
Jupyter notebook themselves. In effect, nbviewer is simply nbconvert as a web service, so you can do your own static
conversions with nbconvert, without relying on nbviewer.
See also:
Details on the notebook JSON file format
Because you use Jupyter in a web browser, some people are understandably concerned about using it with sensitive
data. However, if you followed the standard install instructions, Jupyter is actually running on your own computer. If
the URL in the address bar starts with http://localhost: or http://127.0.0.1:, it’s your computer acting as
the server. Jupyter doesn’t send your data anywhere else—and as it’s open source, other people can check that we’re
being honest about this.
You can also use Jupyter remotely: your company or university might run the server for you, for instance. If you want
to work with sensitive data in those cases, talk to your IT or data protection staff about it.
We aim to ensure that other pages in your browser or other users on the same computer can’t access your notebook
server. See the security documentation for more about this.
You can start running a notebook server from the command line using the following command:
jupyter notebook
This will print some information about the notebook server in your console, and open a web browser to the URL of the
web application (by default, http://127.0.0.1:8888).
The landing page of the Jupyter notebook web application, the dashboard, shows the notebooks currently available in
the notebook directory (by default, the directory from which the notebook server was started).
You can create new notebooks from the dashboard with the New Notebook button, or open existing ones by clicking
on their name. You can also drag and drop .ipynb notebooks and standard .py Python source code files into the
notebook list area.
When starting a notebook server from the command line, you can also open a particular notebook directly, bypassing
the dashboard, with jupyter notebook my_notebook.ipynb. The .ipynb extension is assumed if no extension is
given.
When you are inside an open notebook, the File | Open. . . menu option will open the dashboard in a new browser tab,
to allow you to open another notebook from the notebook directory or to create a new notebook.
Note: You can start more than one notebook server at the same time, if you want to work on notebooks in different
directories. By default the first notebook server starts on port 8888, and later notebook servers search for ports near
that one. You can also manually specify the port with the --port option.
A new notebook may be created at any time, either from the dashboard, or using the File → New menu option from
within an active notebook. The new notebook is created within the same directory and will open in a new browser tab.
It will also be reflected as a new entry in the notebook list on the dashboard.
Opening notebooks
An open notebook has exactly one interactive session connected to a kernel, which will execute code sent by the user
and communicate back results. This kernel remains active if the web browser window is closed, and reopening the
same notebook from the dashboard will reconnect the web application to the same kernel. In the dashboard, notebooks
with an active kernel have a Shutdown button next to them, whereas notebooks without an active kernel have a Delete
button in its place.
Other clients may connect to the same kernel. When each kernel is started, the notebook server prints to the terminal
a message like this:
This long string is the kernel’s ID which is sufficient for getting the information necessary to connect to the kernel. If
the notebook uses the IPython kernel, you can also see this connection data by running the %connect_info magic,
which will print the same ID information along with other details.
You can then, for example, manually start a Qt console connected to the same kernel from the command line, by passing
a portion of the ID:
Without an ID, --existing will connect to the most recently started kernel.
With the IPython kernel, you can also run the %qtconsole magic in the notebook to open a Qt console connected to
the same kernel.
See also:
Decoupled two-process model
When you create a new notebook document, you will be presented with the notebook name, a menu bar, a toolbar
and an empty code cell.
Notebook name: The name displayed at the top of the page, next to the Jupyter logo, reflects the name of the .ipynb
file. Clicking on the notebook name brings up a dialog which allows you to rename it. Thus, renaming a notebook
from “Untitled0” to “My first notebook” in the browser, renames the Untitled0.ipynb file to My first notebook.
ipynb.
Menu bar: The menu bar presents different options that may be used to manipulate the way the notebook functions.
Toolbar: The tool bar gives a quick way of performing the most-used operations within the notebook, by clicking on
an icon.
Code cell: the default type of cell; read on for an explanation of cells.
The notebook consists of a sequence of cells. A cell is a multiline text input field, and its contents can be executed by
using Shift-Enter, or by clicking either the “Play” button the toolbar, or Cell, Run in the menu bar. The execution
behavior of a cell is determined by the cell’s type. There are three types of cells: code cells, markdown cells, and raw
cells. Every cell starts off being a code cell, but its type can be changed by using a drop-down on the toolbar (which
will be “Code”, initially), or via keyboard shortcuts.
For more information on the different things you can do in a notebook, see the collection of examples.
Code cells
A code cell allows you to edit and write new code, with full syntax highlighting and tab completion. The programming
language you use depends on the kernel, and the default kernel (IPython) runs Python code.
When a code cell is executed, code that it contains is sent to the kernel associated with the notebook. The results that
are returned from this computation are then displayed in the notebook as the cell’s output. The output is not limited to
text, with many other possible forms of output are also possible, including matplotlib figures and HTML tables (as
used, for example, in the pandas data analysis package). This is known as IPython’s rich display capability.
See also:
Rich Output example notebook
Markdown cells
You can document the computational process in a literate way, alternating descriptive text with code, using rich text.
In IPython this is accomplished by marking up text with the Markdown language. The corresponding cells are called
Markdown cells. The Markdown language provides a simple way to perform this text markup, that is, to specify which
parts of the text should be emphasized (italics), bold, form lists, etc.
If you want to provide structure for your document, you can use markdown headings. Markdown headings consist of
1 to 6 hash # signs # followed by a space and the title of your section. The markdown heading will be converted to a
clickable link for a section of the notebook. It is also used as a hint when exporting to other document formats, like
PDF.
When a Markdown cell is executed, the Markdown code is converted into the corresponding formatted rich text. Mark-
down allows arbitrary HTML code for formatting.
Within Markdown cells, you can also include mathematics in a straightforward way, using standard LaTeX notation:
$...$ for inline mathematics and $$...$$ for displayed mathematics. When the Markdown cell is executed, the
LaTeX portions are automatically rendered in the HTML output as equations with high quality typography. This is
made possible by MathJax, which supports a large subset of LaTeX functionality
Standard mathematics environments defined by LaTeX and AMS-LaTeX (the amsmath package) also work, such as
\begin{equation}...\end{equation}, and \begin{align}...\end{align}. New LaTeX macros may be de-
fined using standard methods, such as \newcommand, by placing them anywhere between math delimiters in a Mark-
down cell. These definitions are then available throughout the rest of the IPython session.
See also:
Working with Markdown Cells example notebook
Raw cells
Raw cells provide a place in which you can write output directly. Raw cells are not evaluated by the notebook. When
passed through nbconvert, raw cells arrive in the destination format unmodified. For example, you can type full LaTeX
into a raw cell, which will only be rendered by LaTeX after conversion by nbconvert.
The normal workflow in a notebook is, then, quite similar to a standard IPython session, with the difference that you
can edit cells in-place multiple times until you obtain the desired results, rather than having to rerun separate scripts
with the %run magic command.
Typically, you will work on a computational problem in pieces, organizing related ideas into cells and moving forward
once previous parts work correctly. This is much more convenient for interactive exploration than breaking up a com-
putation into scripts that must be executed together, as was previously necessary, especially if parts of them take a long
time to run.
To interrupt a calculation which is taking too long, use the Kernel, Interrupt menu option, or the i,i keyboard shortcut.
Similarly, to restart the whole computational process, use the Kernel, Restart menu option or 0,0 shortcut.
A notebook may be downloaded as a .ipynb file or converted to a number of other formats using the menu option
File, Download as.
See also:
Running Code in the Jupyter Notebook example notebook
Notebook Basics example notebook
Keyboard shortcuts
All actions in the notebook can be performed with the mouse, but keyboard shortcuts are also available for the most
common ones. The essential shortcuts to remember are the following:
• Shift-Enter: run cell
Execute the current cell, show any output, and jump to the next cell below. If Shift-Enter is invoked on
the last cell, it makes a new cell below. This is equivalent to clicking the Cell, Run menu item, or the Play
button in the toolbar.
• Esc: Command mode
In command mode, you can navigate around the notebook using keyboard shortcuts.
• Enter: Edit mode
In edit mode, you can edit text in cells.
For the full list of available shortcuts, click Help, Keyboard Shortcuts in the notebook menus.
1.1.6 Plotting
One major feature of the Jupyter notebook is the ability to display plots that are the output of running code cells. The
IPython kernel is designed to work seamlessly with the matplotlib plotting library to provide this functionality. Specific
plotting library integration is a feature of the kernel.
For information on how to install a Python kernel, refer to the IPython install page.
The Jupyter wiki has a long list of Kernels for other languages. They usually come with instructions on how to make
the kernel available in the notebook.
To prevent untrusted code from executing on users’ behalf when notebooks open, we store a signature of each trusted
notebook. The notebook server verifies this signature when a notebook is opened. If no matching signature is found,
Javascript and HTML output will not be displayed until they are regenerated by re-executing the cells.
Any notebook that you have fully executed yourself will be considered trusted, and its HTML and Javascript output
will be displayed on load.
If you need to see HTML or Javascript output without re-executing, and you are sure the notebook is not malicious,
you can tell Jupyter to trust it at the command-line with:
See the security documentation for more details about the trust mechanism.
The Jupyter Notebook aims to support the latest versions of these browsers:
• Chrome
• Safari
• Firefox
Up to date versions of Opera and Edge may also work, but if they don’t, please use one of the supported browsers.
Using Safari with HTTPS and an untrusted certificate is known to not work (websockets will fail).
When opening bug reports or sending emails to the Jupyter mailing list, it is useful to know the names of different UI
components so that other developers and users have an easier time helping you diagnose your problems. This section
will familiarize you with the names of UI elements within the Notebook and the different Notebook modes.
When you launch jupyter notebook the first page that you encounter is the Notebook Dashboard.
Once you’ve selected a Notebook to edit, the Notebook will open in the Notebook Editor.
If you would like to learn more about the specific elements within the Notebook Editor, you can go through the user
interface tour by selecting Help in the menubar then selecting User Interface Tour.
When a cell is in edit mode, the Cell Mode Indicator will change to reflect the cell’s state. This state is indicated by a
small pencil icon on the top right of the interface. When the cell is in command mode, there is no icon in that location.
Now let’s say that you’ve chosen to open a Markdown file instead of a Notebook file whilst in the Notebook Dashboard.
If so, the file will be opened in the File Editor.
The pages in this section are all converted notebook files. You can also view these notebooks on nbviewer.
Introduction
The Jupyter Notebook is an interactive computing environment that enables users to author notebook documents that
include: - Live code - Interactive widgets - Plots - Narrative text - Equations - Images - Video
These documents provide a complete and self-contained record of a computation that can be converted to various
formats and shared with others using email, Dropbox, version control systems (like git/GitHub) or nbviewer.jupyter.org.
Components
Kernels
Through Jupyter’s kernel and messaging architecture, the Notebook allows code to be run in a range of different pro-
gramming languages. For each notebook document that a user opens, the web application starts a kernel that runs the
code for that notebook. Each kernel is capable of running code in a single programming language and there are kernels
available in the following languages:
• Python(https://github.com/ipython/ipython)
• Julia (https://github.com/JuliaLang/IJulia.jl)
• R (https://github.com/IRkernel/IRkernel)
• Ruby (https://github.com/minrk/iruby)
• Haskell (https://github.com/gibiansky/IHaskell)
• Scala (https://github.com/Bridgewater/scala-notebook)
• node.js (https://gist.github.com/Carreau/4279371)
• Go (https://github.com/takluyver/igo)
The default kernel runs Python code. The notebook provides a simple way for users to pick which of these kernels is
used for a given notebook.
Each of these kernels communicate with the notebook web application and web browser using a JSON over Ze-
roMQ/WebSockets message protocol that is described here. Most users don’t need to know about these details, but
it helps to understand that “kernels run code.”
Notebook documents
Notebook documents contain the inputs and outputs of an interactive session as well as narrative text that accompa-
nies the code but is not meant for execution. Rich output generated by running code, including HTML, images, video,
and plots, is embeddeed in the notebook, which makes it a complete and self-contained record of a computation.
When you run the notebook web application on your computer, notebook documents are just files on your local filesys-
tem with a .ipynb extension. This allows you to use familiar workflows for organizing your notebooks into folders
and sharing them with others.
Notebooks consist of a linear sequence of cells. There are three basic cell types:
• Code cells: Input and output of live code that is run in the kernel
• Markdown cells: Narrative text with embedded LaTeX equations
• Raw cells: Unformatted text that is included, without modification, when notebooks are converted to different
formats using nbconvert
Internally, notebook documents are JSON data with binary values base64 encoded. This allows them to be read and
manipulated programmatically by any programming language. Because JSON is a text format, notebook documents
are version control friendly.
Notebooks can be exported to different static formats including HTML, reStructeredText, LaTeX, PDF, and slide
shows (reveal.js) using Jupyter’s nbconvert utility.
Furthermore, any notebook document available from a public URL or on GitHub can be shared via nbviewer. This
service loads the notebook document from the URL and renders it as a static web page. The resulting web page may
thus be shared with others without their needing to install the Jupyter Notebook.
When you first start the notebook server, your browser will open to the notebook dashboard. The dashboard serves
as a home page for the notebook. Its main purpose is to display the notebooks and files in the current directory. For
example, here is a screenshot of the dashboard page for the examples directory in the Jupyter repository:
The top of the notebook list displays clickable breadcrumbs of the current directory. By clicking on these breadcrumbs
or on sub-directories in the notebook list, you can navigate your file system.
To create a new notebook, click on the “New” button at the top of the list and select a kernel from the dropdown (as
seen below). Which kernels are listed depend on what’s installed on the server. Some of the kernels in the screenshot
below may not exist as an option to you.
Notebooks and files can be uploaded to the current directory by dragging a notebook file onto the notebook list or by
the “click here” text above the list.
The notebook list shows green “Running” text and a green notebook icon next to running notebooks (as seen below).
Notebooks remain running until you explicitly shut them down; closing the notebook’s page is not sufficient.
To shutdown, delete, duplicate, or rename a notebook check the checkbox next to it and an array of controls will appear
at the top of the notebook list (as seen below). You can also use the same operations on directories and files when
applicable.
To see all of your running notebooks along with their directories, click on the “Running” tab:
This view provides a convenient way to track notebooks that you start as you navigate the file system in a long running
notebook server.
If you create a new notebook or open an existing one, you will be taken to the notebook user interface (UI). This UI
allows you to run code and author notebook documents interactively. The notebook UI has the following main areas:
• Menu
• Toolbar
• Notebook area and cells
The notebook has an interactive tour of these elements that can be started in the “Help:User Interface Tour” menu item.
Modal editor
Starting with IPython 2.0, the Jupyter Notebook has a modal user interface. This means that the keyboard does different
things depending on which mode the Notebook is in. There are two modes: edit mode and command mode.
Edit mode
Edit mode is indicated by a green cell border and a prompt showing in the editor area:
When a cell is in edit mode, you can type into the cell, like a normal text editor.
Enter edit mode by pressing Enter or using the mouse to click on a cell’s editor area.
Command mode
Command mode is indicated by a grey cell border with a blue left margin:
When you are in command mode, you are able to edit the notebook as a whole, but not type into individual cells. Most
importantly, in command mode, the keyboard is mapped to a set of shortcuts that let you perform notebook and cell
actions efficiently. For example, if you are in command mode and you press c, you will copy the current cell - no
modifier is needed.
Don’t try to type into a cell in command mode; unexpected things will happen!
Enter command mode by pressing Esc or using the mouse to click outside a cell’s editor area.
Mouse navigation
All navigation and actions in the Notebook are available using the mouse through the menubar and toolbar, which are
both above the main Notebook area:
The first idea of mouse based navigation is that cells can be selected by clicking on them. The currently selected cell
gets a grey or green border depending on whether the notebook is in edit or command mode. If you click inside a cell’s
editor area, you will enter edit mode. If you click on the prompt or output area of a cell you will enter command mode.
If you are running this notebook in a live session (not on http://nbviewer.jupyter.org) try selecting different cells and
going between edit and command mode. Try typing into a cell.
The second idea of mouse based navigation is that cell actions usually apply to the currently selected cell. Thus if
you want to run the code in a cell, you would select it and click the
button in the toolbar or the “Cell:Run” menu item. Similarly, to copy a cell you would select it and click the
button in the toolbar or the “Edit:Copy” menu item. With this simple pattern, you should be able to do most everything
you need with the mouse.
Markdown cells have one other state that can be modified with the mouse. These cells can either be rendered or
unrendered. When they are rendered, you will see a nice formatted representation of the cell’s contents. When they are
unrendered, you will see the raw text source of the cell. To render the selected cell with the mouse, click the
button in the toolbar or the “Cell:Run” menu item. To unrender the selected cell, double click on the cell.
Keyboard Navigation
The modal user interface of the Jupyter Notebook has been optimized for efficient keyboard usage. This is made
possible by having two different sets of keyboard shortcuts: one set that is active in edit mode and another in command
mode.
The most important keyboard shortcuts are Enter, which enters edit mode, and Esc, which enters command mode.
In edit mode, most of the keyboard is dedicated to typing into the cell’s editor. Thus, in edit mode there are relatively
few shortcuts. In command mode, the entire keyboard is available for shortcuts, so there are many more. The Help-
>``Keyboard Shortcuts`` dialog lists the available shortcuts.
We recommend learning the command mode shortcuts in the following rough order:
1. Basic navigation: enter, shift-enter, up/k, down/j
2. Saving the notebook: s
3. Change Cell types: y, m, 1-6, t
4. Cell creation: a, b
5. Cell editing: x, c, v, d, z
6. Kernel operations: i, 0 (press twice)
First and foremost, the Jupyter Notebook is an interactive environment for writing and running code. The notebook is
capable of running code in a wide range of languages. However, each notebook is associated with a single kernel. This
notebook is associated with the IPython kernel, therefore runs Python code.
[1]: a = 10
[2]: print(a)
10
Code is run in a separate process called the Kernel. The Kernel can be interrupted or restarted. Try running the
following cell and then hit the
button in the toolbar above.
If the Kernel dies you will be prompted to restart it. Here we call the low-level system libc.time routine with the wrong
argument via ctypes to segfault the Python interpreter:
Cell menu
The “Cell” menu has a number of menu items for running code in different ways. These includes:
• Run and Select Below
• Run and Insert Below
• Run All
• Run All Above
• Run All Below
The kernel maintains the state of a notebook’s computations. You can reset this state by restarting the kernel. This is
done by clicking on the
in the toolbar above.
The stdout and stderr streams are displayed as text in the output area.
hi, stderr
Output is asynchronous
All output is displayed asynchronously as it is generated in the Kernel. If you execute the next cell, you will see the
output one piece at a time, not all at the end.
Large outputs
To better handle large outputs, the output area can be collapsed. Run the following cell and then single- or double-
click on the active area to the left of the output:
[9]: for i in range(50):
print(i)
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(continues on next page)
Text can be added to Jupyter Notebooks using Markdown cells. You can change the cell type to Markdown by using the
Cell menu, the toolbar, or the key shortcut m. Markdown is a popular markup language that is a superset of HTML.
Its specification can be found here:
https://daringfireball.net/projects/markdown/
Markdown basics
You can make text italic or bold by surrounding a block of text with a single or double * respectively
You can build nested itemized or enumerated lists:
• One
– Sublist
∗ This
• Sublist - That - The other thing
• Two
• Sublist
• Three
• Sublist
Now another list:
1. Here we go
1. Sublist
2. Sublist
2. There we go
3. Now this
You can add horizontal rules:
Here is a blockquote:
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is
better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special
cases aren’t special enough to break the rules. Although practicality beats purity. Errors should never
pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There
should be one– and preferably only one –obvious way to do it. Although that way may not be obvious at
first unless you’re Dutch. Now is better than never. Although never is often better than right now. If the
implementation is hard to explain, it’s a bad idea. If the implementation is easy to explain, it may be a
good idea. Namespaces are one honking great idea – let’s do more of those!
And shorthand for links:
Jupyter’s website
You can use backslash to generate literal characters which would otherwise have special meaning in the Markdown
syntax.
\*literal asterisks\*
*literal asterisks*
Headings
You can add headings by starting a line with one (or multiple) # followed by a space, as in the following example:
# Heading 1
# Heading 2
## Heading 2.1
## Heading 2.2
Embedded code
You can embed code meant for illustration instead of execution in Python:
def f(x):
"""a docstring"""
return x**2
or other languages:
LaTeX equations
Courtesy of MathJax, you can include mathematical expressions both inline: 𝑒𝑖𝜋 + 1 = 0 and displayed:
∞
∑︁ 1 𝑖
𝑒𝑥 = 𝑥 (1.1)
𝑖=0
𝑖!
$e^{i\pi} + 1 = 0$
\begin{equation}
e^x=\sum_{i=0}^\infty \frac{1}{i!}x^i
\end{equation}
The Notebook webapp supports Github flavored markdown meaning that you can use triple backticks for code blocks:
```python
print "Hello World"
```
```javascript
console.log("Hello World")
```
Gives:
console.log("Hello World")
| This | is |
|------|------|
| a | table|
This is
a table
General HTML
Because Markdown is a superset of HTML you can even add things like HTML tables:
Header 1
Header 2
row 1, cell 1
row 1, cell 2
row 2, cell 1
row 2, cell 2
Local files
If you have local files in your Notebook directory, you can refer to these files in Markdown cells directly:
[subdirectory/]<filename>
animation
These do not embed the data into the notebook file, and require that the files exist when you are viewing the notebook.
Note that this means that the Jupyter notebook server also acts as a generic file server for files inside the same tree as
your notebooks. Access is not granted outside the notebook folder so you have strict control over what files are visible,
but for this reason it is highly recommended that you do not run the notebook server with a notebook directory at a
high level in your filesystem (e.g. your home directory).
When you run the notebook in a password-protected manner, local file access is restricted to authenticated users unless
read-only views are active.
Markdown attachments
Since Jupyter notebook version 5.0, in addition to referencing external file you can attach a file to a markdown cell. To
do so drag the file from in a markdown cell while editing it:
Files are stored in cell metadata and will be automatically scrubbed at save-time if not referenced. You can recognized
attached images from other files by their url that starts with attachment:. For the image above:

Keep in mind that attached files will increase the size of your notebook.
You can manually edit the attachment by using the View > Cell Toolbar > Attachment menu, but you should
not need to.
You can customize the command mode shortcuts from within the Notebook Application itself.
Head to the Settings menu and select the Settings Editor item. A dialog will guide you through the process of adding
custom keyboard shortcuts.
Keyboard shortcut set from within the Notebook Application will be persisted to your configuration file. A single action
may have several shortcuts attached to it.
It is a common problem that people want to import code from Jupyter Notebooks. This is made difficult by the fact that
Notebooks are not plain Python files, and thus cannot be imported by the regular Python machinery.
Fortunately, Python provides some fairly sophisticated hooks into the import machinery, so we can actually make
Jupyter notebooks importable without much difficulty, and only using public APIs.
Notebook Loader
Here we have our Notebook Loader. It’s actually quite simple - once we figure out the filename of the module, all it
does is:
1. load the notebook document into memory
2. create an empty Module
3. execute every cell in the Module namespace
Since IPython cells can have extended syntax, the IPython transform is applied to turn each of these cells into their
pure-Python counterparts before executing them. If all of your notebook cells are pure-Python, this step is unnecessary.
[ ]: class NotebookLoader(object):
"""Module Loader for Jupyter Notebooks"""
def __init__(self, path=None):
(continues on next page)
# extra work to ensure that magics that would affect the user_ns
# actually affect the notebook module's ns
save_user_ns = self.shell.user_ns
self.shell.user_ns = mod.__dict__
try:
for cell in nb.cells:
if cell.cell_type == 'code':
# transform the input to executable Python
code = self.shell.input_transformer_manager.transform_cell(cell.source)
# run the code in themodule
exec(code, mod.__dict__)
finally:
self.shell.user_ns = save_user_ns
return mod
The finder is a simple object that tells you whether a name can be imported, and returns the appropriate loader. All this
one does is check, when you do:
import mynotebook
[ ]: class NotebookFinder(object):
"""Module finder that locates Jupyter Notebooks"""
def __init__(self):
self.loaders = {}
key = path
if path:
# lists aren't hashable
key = os.path.sep.join(path)
[ ]: sys.meta_path.append(NotebookFinder())
[ ]: ls nbpackage
[ ]: import nbpackage.mynotebook
Here is some simple code to display the contents of a notebook with syntax highlighting, etc.
formatter = HtmlFormatter()
lexer = PythonLexer()
[ ]: def show_notebook(fname):
"""display a short summary of the cells of a notebook"""
with io.open(fname, 'r', encoding='utf-8') as f:
nb = read(f, 4)
html = []
for cell in nb.cells:
html.append("<h4>%s cell</h4>" % cell.cell_type)
if cell.cell_type == 'code':
html.append(highlight(cell.source, lexer, formatter))
else:
html.append("<pre>%s</pre>" % cell.source)
display(HTML('\n'.join(html)))
show_notebook(os.path.join("nbpackage", "mynotebook.ipynb"))
So my notebook has some code cells, one of which contains some IPython syntax.
Let’s see what happens when we import it
[ ]: mynotebook.foo()
Hooray again!
Even the function that contains IPython syntax works:
[ ]: mynotebook.has_ip_syntax()
Notebooks in packages
We also have a notebook inside the nb package, so let’s make sure that works as well.
[ ]: ls nbpackage/nbs
Note that the __init__.py is necessary for nb to be considered a package, just like usual.
So now we have importable notebooks, from both the local directory and inside packages.
I can even put a notebook inside IPython, to further demonstrate that this is working properly:
[ ]: import shutil
from IPython.paths import get_ipython_package_dir
This approach can even import functions and classes that are defined in a notebook using the %%cython magic.
The traditional IPython (ipython) consists of a single process that combines a terminal based UI with the process that
runs the users code.
While this traditional application still exists, the modern Jupyter consists of two processes:
• Kernel: this is the process that runs the users code.
• Frontend: this is the process that provides the user interface where the user types code and sees results.
Jupyter currently has 3 frontends:
• Terminal Console (jupyter console)
• Qt Console (jupyter qtconsole)
• Notebook (jupyter notebook)
The Kernel and Frontend communicate over a ZeroMQ/JSON based messaging protocol, which allows multiple Fron-
tends (even of different types) to communicate with a single Kernel. This opens the door for all sorts of interesting
things, such as connecting a Console or Qt Console to a Notebook’s Kernel. For example, you may want to connect
a Qt console to your Notebook’s Kernel and use it as a help browser, calling ?? on objects in the Qt console (whose
pager is more flexible than the one in the notebook).
This Notebook describes how you would connect another Frontend to an IPython Kernel that is associated with a
Notebook. The commands currently given here are specific to the IPython kernel.
Manual connection
To connect another Frontend to a Kernel manually, you first need to find out the connection information for the Kernel
using the %connect_info magic:
[ ]: %connect_info
You can see that this magic displays everything you need to connect to this Notebook’s Kernel.
You can also start a new Qt Console connected to your current Kernel by using the %qtconsole magic. This will
detect the necessary connection information and start the Qt Console for you automatically.
[ ]: a = 10
[ ]: %qtconsole
The Markdown parser included in the Jupyter Notebook is MathJax-aware. This means that you can freely mix in
mathematical expressions using the MathJax subset of Tex and LaTeX. Some examples from the MathJax demos site
are reproduced below, as well as the Markdown+TeX source.
Source
\begin{align}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{align}
Display
Source
\begin{equation*}
\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_
˓→{k=1}^n b_k^2 \right)
\end{equation*}
Display
∑︀𝑛 2 (︀∑︀𝑛 2
)︀ (︀∑︀𝑛 2
)︀
( 𝑘=1 𝑎𝑘 𝑏𝑘 ) ≤ 𝑘=1 𝑎𝑘 𝑘=1 𝑏𝑘
Source
\begin{equation*}
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
\end{vmatrix}
\end{equation*}
Display
⃒ ⃒
⃒ i j k⃒⃒
V1 × V2 = ⃒⃒ 𝜕𝑋
⃒ 𝜕𝑌
𝜕𝑢 𝜕𝑢 0 ⃒⃒
⃒ 𝜕𝑋 𝜕𝑌
0⃒
𝜕𝑣 𝜕𝑣
Source
\begin{equation*}
P(E) = {n \choose k} p^k (1-p)^{ n-k}
\end{equation*}
Display
(︀𝑛)︀
𝑃 (𝐸) = 𝑘 𝑝𝑘 (1 − 𝑝)𝑛−𝑘
An Identity of Ramanujan
Source
\begin{equation*}
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
{1+\frac{e^{-8\pi}} {1+\ldots} } } }
\end{equation*}
Display
1 )︁ 𝑒−2𝜋
(︁√
√
=1+ 𝑒−4𝜋
2 1+
𝜑 5−𝜑 𝑒 5 𝜋 1+ 𝑒−6𝜋
−8𝜋
1+ 𝑒
1+...
A Rogers-Ramanujan Identity
Source
\begin{equation*}
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
\prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
\quad\quad \text{for $|q|<1$}.
\end{equation*}
Display
∞
𝑞2 𝑞6 ∏︁ 1
1+ + 2
+ · · · = 5𝑗+2
, for |𝑞| < 1.
(1 − 𝑞) (1 − 𝑞)(1 − 𝑞 ) 𝑗=0
(1 − 𝑞 )(1 − 𝑞 5𝑗+3 )
Maxwell’s Equations
Source
\begin{align}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t}␣
˓→& = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial␣
˓→t} & = \vec{\mathbf{0}} \\
Display
Equation numbering and referencing will be available in a future version of the Jupyter notebook.
While display equations look good for a page of samples, the ability to mix math and formatted text in a paragraph is
also important.
Source
Display
√
This expression 3𝑥 − 1 + (1 + 𝑥)2 is an example of a TeX inline equation in a Markdown-formatted sentence.
Other Syntax
You will notice in other places on the web that $$ are needed explicitly to begin and end MathJax typesetting. This
is not required if you will be using TeX environments, but the Jupyter notebook will accept this syntax on legacy
notebooks.
Source
$$
\begin{array}{c}
y_1 \\\
y_2 \mathtt{t}_i \\\
z_{3,4}
\end{array}
$$
$$
\begin{array}{c}
y_1 \cr
y_2 \mathtt{t}_i \cr
y_{3}
\end{array}
$$
$$\begin{eqnarray}
x' &=& &x \sin\phi &+& z \cos\phi \\
z' &=& - &x \cos\phi &+& z \sin\phi \\
\end{eqnarray}$$
$$
x=4
$$
Display
𝑦1
𝑦2 t𝑖
𝑧3,4
𝑦1
𝑦2 t𝑖
𝑦3
𝑡𝑜
𝑥′ =
𝑥 sin 𝜑
+𝑧 cos 𝜑
𝑧′ =
−𝑥 cos 𝜑
+𝑧 sin 𝜑
(1.2)
+
-=
+𝑥 cos 𝜑
𝑧 sin 𝜑
𝑥=4
First, have a look at the common problems listed below. If you can figure it out from these notes, it will be quicker than
asking for help.
Check that you have the latest version of any packages that look relevant. Unfortunately it’s not always easy to figure
out what packages are relevant, but if there was a bug that’s already been fixed, it’s easy to upgrade and get on with
what you wanted to do.
• Try in another browser (e.g. if you normally use Firefox, try with Chrome). This helps pin down where the
problem is.
• Try disabling any browser extensions and/or any Jupyter extensions you have installed.
• Some internet security software can interfere with Jupyter. If you have security software, try turning it off
temporarily, and look in the settings for a more long-term solution.
• In the address bar, try changing between localhost and 127.0.0.1. They should be the same, but in some
cases it makes a difference.
Files called kernel specs tell Jupyter how to start different kinds of kernels. To see where these are on your system, run
jupyter kernelspec list:
There’s a special fallback for the Python kernel: if it doesn’t find a real kernelspec, but it can import the ipykernel
package, it provides a kernel which will run in the same Python environment as the notebook server. A path ending
in ipykernel/resources, like in the example above, is this default kernel. The default often does what you want,
so if the python3 kernelspec points somewhere else and you can’t start a Python kernel, try deleting or renaming that
kernelspec folder to expose the default.
If your problem is with another kernel, not the Python one we maintain, you may need to look for support about that
kernel.
Multiple python environments, whether based on Anaconda or Python Virtual environments, are often the source of
reported issues. In many cases, these issues stem from the Notebook server running in one environment, while the
kernel and/or its resources, derive from another environment. Indicators of this scenario include:
• import statements within code cells producing ImportError or ModuleNotFound exceptions.
• General kernel startup failures exhibited by nothing happening when attempting to execute a cell.
In these situations, take a close look at your environment structure and ensure all packages required by your note-
book’s code are installed in the correct environment. If you need to run the kernel from different environments than
your Notebook server, check out IPython’s documentation for using kernels from different environments as this is the
recommended approach. Anaconda’s nb_conda_kernels package might also be an option for you in these scenarios.
Another thing to check is the kernel.json file that will be located in the aforementioned kernel specs directory
identified by running jupyter kernelspec list. This file will contain an argv stanza that includes the actual
command to run when launching the kernel. Oftentimes, when reinstalling python environments, a previous kernel.
json will reference an python executable from an old or non-existent location. As a result, it’s always a good idea when
encountering kernel startup issues to validate the argv stanza to ensure all file references exist and are appropriate.
Although Jupyter Notebook is primarily developed on the various flavors of the Unix operating system it also supports
Microsoft Windows - which introduces its own set of commonly encountered issues, particularly in the areas of security,
process management and lower-level libraries.
pywin32 Issues
File "c:\users\jovyan\python\myenv.venv\lib\site-packages\jupyter_core\paths.py",␣
˓→line 424, in secure_write
win32_restrict_file_to_user(fname)
File "c:\users\jovyan\python\myenv.venv\lib\site-packages\jupyter_core\paths.py",␣
˓→line 359, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: The specified module could not be found.
• As noted earlier, the installation of pywin32 can be problematic on Windows configurations. When such an
issue occurs, you may need to revisit how the environment was setup. Pay careful attention to whether you’re
running the 32 or 64 bit versions of Windows and be sure to install appropriate packages for that environment.
Here’s a portion of such a traceback:
File "C:\Users\jovyan\AppData\Roaming\Python\Python37\site-packages\jupyter_core\
˓→paths.py", line 435, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\jovyan\AppData\Roaming\Python\Python37\site-packages\jupyter_core\
˓→paths.py", line 361, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: %1 is not a valid Win32 application
In this case, your pywin32 module may not be installed correctly and the following should be attempted:
or:
followed by:
The Jupyter stack is very complex and rightfully so, there’s a lot going on. On occasion you might find the system
working perfectly well, then, suddenly, you can’t get past a certain cell due to import failures. In these situations, it’s
best to ask yourself if any new python files were added to your notebook development area.
These issues are usually evident by carefully analyzing the traceback produced in the notebook error or the Notebook
server’s command window. In these cases, you’ll typically find the Python kernel code (from IPython and ipykernel)
performing its imports and notice a file from your Notebook development error included in that traceback followed by
an AttributeError:
What has happened is that you have named a file that conflicts with an installed package that is used by the kernel
software and now introduces a conflict preventing the kernel’s startup.
Resolution: You’ll need to rename your file. A best practice would be to prefix or namespace your files so as not to
conflict with any python package.
As with any problem, try searching to see if someone has already found an answer. If you can’t find an existing answer,
you can ask questions at:
• The Jupyter Discourse Forum
• The jupyter-notebook tag on Stackoverflow
• Peruse the jupyter/help repository on Github (read-only)
• Or in an issue on another repository, if it’s clear which component is responsible. Typical repositories include:
– jupyter_core - secure_write() and file path issues
– jupyter_client - kernel management issues found in Notebook server’s command window.
– IPython and ipykernel - kernel runtime issues typically found in Notebook server’s command window
and/or Notebook cell execution.
Gathering Information
Should you find that your problem warrants that an issue be opened in notebook please don’t forget to provide details
like the following:
• What error messages do you see (within your notebook and, more importantly, in the Notebook server’s command
window)?
• What platform are you on?
• How did you install Jupyter?
• What have you tried already?
The jupyter troubleshoot command collects a lot of information about your installation, which can also be useful.
When providing textual information, it’s most helpful if you can scrape the contents into the issue rather than providing
a screenshot. This enables others to select pieces of that content so they can search more efficiently and try to help.
Remember that it’s not anyone’s job to help you. We want Jupyter to work for you, but we can’t always help everyone
individually.
1.5 Changelog
A summary of changes in the Jupyter notebook. For more detailed information, see GitHub.
Use pip install notebook --upgrade or conda upgrade notebook to upgrade to the latest release.
We strongly recommend that you upgrade pip to version 9+ of pip before upgrading notebook.
Use pip install pip --upgrade to upgrade pip. Check pip version with pip --version.
1.5.1 7.0.0a5
(Full Changelog)
Enhancements made
1.5.2 7.0.0a4
(Full Changelog)
Enhancements made
1.5. Changelog 51
Jupyter Notebook Documentation, Release 7.0.0a5
1.5.3 7.0.0a3
(Full Changelog)
Enhancements made
Bugs fixed
Documentation improvements
1.5.4 7.0.0a2
(Full Changelog)
Enhancements made
• Add support for opening a document with a different factory #6315 (@jtpio)
• Minor copy edit in README #6313 (@jweill-aws)
Bugs fixed
Documentation improvements
1.5. Changelog 53
Jupyter Notebook Documentation, Release 7.0.0a5
1.5.5 7.0.0a1
(Full Changelog)
Enhancements made
1.5.6 6.4.8
(Full Changelog)
Bugs fixed
• Fix to remove potential memory leak on Jupyter Notebooks ZMQChannelHandler code #6251 (@Vishwa-
jeet0510)
1.5.7 6.4.7
(Full Changelog)
Bugs fixed
1.5.8 6.4.6
(Full Changelog)
Bugs fixed
1.5. Changelog 55
Jupyter Notebook Documentation, Release 7.0.0a5
1.5.9 6.4.5
(Full Changelog)
Bug fixes
Documentation improvements
1.5.10 6.4.4
(Full Changelog)
Documentation improvements
• Use default JupyterLab CSS sanitizer options for Markdown #6160 (@krassowski)
• Fix syntax highlight #6128 (@massongit)
1.5.11 6.4.3
(Full Changelog)
Bugs fixed
1.5.12 6.4.2
(Full Changelog)
Bugs fixed
1.5. Changelog 57
Jupyter Notebook Documentation, Release 7.0.0a5
1.5.13 6.4.0
(Full Changelog)
Bugs fixed
• Revert “do not apply asyncio patch for tornado >=6.1” #6052 (@minrk)
• Use Jupyter Releaser #6048 (@afshin)
• Add Workflow Permissions for Lock Bot #6042 (@jtpio)
• Fixes related to the recent changes in the documentation #6021 (@frenzymadness)
• Add maths checks in CSS reference test #6035 (@stef4k)
• Add Issue Lock and Answered Bots #6019 (@afshin)
Documentation improvements
1.5.14 6.3.0
Merged PRs
1.5. Changelog 59
Jupyter Notebook Documentation, Release 7.0.0a5
1.5.15 6.2.0
1.5.17 6.1.6
1.5.19 6.1.5
1.5.20 6.1.4
1.5.21 6.1.3
1.5.22 6.1.2
1.5.23 6.1.1
1.5. Changelog 61
Jupyter Notebook Documentation, Release 7.0.0a5
1.5.24 6.1.0
Please note that this repository is currently maintained by a skeleton crew of maintainers from the Jupyter community.
For our approach moving forward, please see this notice from the README. Thank you.
Here is an enumeration of changes made since the last release and included in 6.1.0.
• Remove deprecated encoding parameter for Python 3.9 compatibility. (5174)
• Add support for async kernel management (4479)
• Fix typo in password_required help message (5320)
• Gateway only: Ensure launch and request timeouts are in sync (5317)
• Update Markdown Cells example to HTML5 video tag (5411)
• Integrated LoginWidget into edit to enable users to logout from the t. . . (5406)
• Update message about minimum Tornado version (5222)
• Logged notebook type (5425)
• Added nl language (5354)
• Add UNIX socket support to notebook server. (4835)
• Update CodeMirror dependency (5198)
• Tree added download multiple files (5351)
• Toolbar buttons tooltip: show help instead of label (5107)
• Remove unnecessary import of requests_unixsocket (5451)
• Add ability to cull terminals and track last activity (5372)
• Code refactoring notebook.js (5352)
• Install terminado for docs build (5462)
• Convert notifications JS test to selenium (5455)
• Add cell attachments to markdown example (5412)
• Add Japanese document (5231)
• Migrate Move multiselection test to selenium (5158)
• Use cmdtrl-enter to run a cell (5120)
• Fix broken “Raw cell MIME type” dialog (5385)
• Make a notebook writable after successful save-as (5296)
• Add actual watch script (4738)
• Added --autoreload flag to NotebookApp (4795)
• Enable check_origin on gateway websocket communication (5471)
• Restore detection of missing terminado package (5465)
• Culling: ensure last_activity attr exists before use (5355)
• Added functionality to allow filter kernels by Jupyter Enterprise Gat. . . (5484)
• ‘Play’ icon for run-cell toolbar button (2922)
• Bump minimum version of jQuery to 3.5.0 (5491)
1.5. Changelog 63
Jupyter Notebook Documentation, Release 7.0.0a5
• Aman Bansal
• Ben Thayer
• berendjan
• Bruno P. Kinoshita
• bzinberg
• Christophe Cadilhac
• Daiki Katsuragawa
• David Lukes
• Dmitriy Q
• dmpe
• dylanzjy
• dSchurch
• E. M. Bray
• ErwinRussel
• Felix Mönckemeyer
• Grant Nestor
• Jarrad Whitaker
• Jesus Panales Castillo
• Joshua Zeltser
• Karthikeyan Singaravelan
• Kenichi Ito
• Kevin Bates
• Koki Nishihara
• Kris Wilson
• Kyle Kelley
• Laura Merlo
• levinxo
• Luciano Resende
• Luis Cabezon Manchado
• Madhusudhan Srinivasa
• Matthias Geier
• mattn
• Max Klein
• Min RK
• Mingxuan Lin
• Mohammad Mostafa Farzan
• Niko Felger
• Norah Abanumay
• Onno Broekmans
• PierreMB
• pinarkavak
• Ram Rachum
• Reece Hart
• Remi Rampin
• Rohit Sanjay
• Shane Canon
• Simon Li
• Steinar Sturlaugsson
• Steven Silvester
• taohan16
• Thew Dhanat
• Thomas Kluyver
• Toon Baeyens
• Vidar Tonaas Fauske
• Zachary Sailer
1.5.25 6.0.3
1.5. Changelog 65
Jupyter Notebook Documentation, Release 7.0.0a5
• Shuichiro MAKIGAKI
• krinsman
• TPartida
• Landen McDonald
• Tres DuBiel
1.5.26 6.0.2
1.5.27 6.0.1
1.5.28 6.0
This is the first major release of the Jupyter Notebook since version 5.0 (March 2017).
We encourage users to start trying JupyterLab, which has just announced it’s 1.0 release in preparation for a future
transition.
• Remove Python 2.x support in favor of Python 3.5 and higher.
• Multiple accessibility enhancements and bug-fixes.
• Multiple translation enhancements and bug-fixes.
• Remove deprecated ANSI CSS styles.
• Native support to forward requests to Jupyter Gateway(s) (Embedded NB2KG).
• Use JavaScript to redirect users to notebook homepage.
• Enhanced SSL/TLS security by using PROTOCOL_TLS which selects the highest ssl/tls protocol version avail-
able that both the client and server support. When PROTOCOL_TLS is not available use PROTOCOL_SSLv23.
• Add ?no_track_activity=1 argument to allow API requests. to not be registered as activity (e.g. API calls
by external activity monitors).
• Kernels shutting down due to an idle timeout is no longer considered an activity-updating event.
• Further improve compatibility with tornado 6 with improved checks for when websockets are closed.
• Launch the browser with a local file which redirects to the server address including the authentication token. This
prevents another logged-in user from stealing the token from command line arguments and authenticating to the
server. The single-use token previously used to mitigate this has been removed. Thanks to Dr. Owain Kenway
for suggesting the local file approach.
• Respect nbconvert entrypoints as sources for exporters
• Update to CodeMirror to 5.37, which includes f-string syntax for Python 3.6.
• Update jquery-ui to 1.12
• Execute cells by clicking icon in input prompt.
• New “Save as” menu option.
• When serving on a loopback interface, protect against DNS rebinding by checking the Host header from the
browser. This check can be disabled if necessary by setting NotebookApp.allow_remote_access. (Disabled
by default while we work out some Mac issues in 3754).
• Add kernel_info_timeout traitlet to enable restarting slow kernels.
• Add custom_display_host config option to override displayed URL.
• Add /metrics endpoint for Prometheus Metrics.
• Optimize large file uploads.
• Allow access control headers to be overriden in jupyter_notebook_config.py to support greater CORS and proxy
configuration flexibility.
• Add support for terminals on windows.
• Add a “restart and run all” button to the toolbar.
• Frontend/extension-config: allow default json files in a .d directory.
• Allow setting token via jupyter_token env.
• Cull idle kernels using --MappingKernelManager.cull_idle_timeout.
1.5. Changelog 67
Jupyter Notebook Documentation, Release 7.0.0a5
• Daniel Farrell
• Daniel Nicolai
• Darío Hereñú
• Dave Aitken
• Dave Foster
• Dave Hirschfeld
• Denis Ledoux
• Dmitry Mikushin
• Dominic Kuang
• Douglas Hanley
• Elliott Sales de Andrade
• Emilio Talamante Lugo
• Eric Perry
• Ethan T. Hendrix
• Evan Van Dam
• Francesco Franchina
• Frédéric Chapoton
• Félix-Antoine Fortin
• Gabriel
• Gabriel Nützi
• Gabriel Ruiz
• Gestalt LUR
• Grant Nestor
• Gustavo Efeiche
• Harsh Vardhan
• Heng GAO
• Hisham Elsheshtawy
• Hong Xu
• Ian Rose
• Ivan Ogasawara
• J Forde
• Jason Grout
• Jessica B. Hamrick
• Jiaqi Liu
• John Emmons
• Josh Barnes
1.5. Changelog 69
Jupyter Notebook Documentation, Release 7.0.0a5
• Karthik Balakrishnan
• Kevin Bates
• Kirit Thadaka
• Kristian Gregorius Hustad
• Kyle Kelley
• Leo Gallucci
• Lilian Besson
• Lucas Seiki Oshiro
• Luciano Resende
• Luis Angel Rodriguez Guerrero
• M Pacer
• Maarten Breddels
• Mac Knight
• Madicken Munk
• Maitiú Ó Ciaráin
• Marc Udoff
• Mathis HAMMEL
• Mathis Rosenhauer
• Matthias Bussonnier
• Matthias Geier
• Max Vovshin
• Maxime Mouchet
• Michael Chirico
• Michael Droettboom
• Michael Heilman
• Michael Scott Cuthbert
• Michal Charemza
• Mike Boyle
• Milos Miljkovic
• Min RK
• Miro Hrončok
• Nicholas Bollweg
• Nitesh Sawant
• Ondrej Jariabka
• Park Hae Jin
• Paul Ivanov
• Paul Masson
• Peter Parente
• Pierre Tholoniat
• Remco Verhoef
• Roland Weber
• Roman Kornev
• Rosa Swaby
• Roy Hyunjin Han
• Sally
• Sam Lau
• Samar Sultan
• Shiti Saxena
• Simon Biggs
• Spencer Park
• Stephen Ward
• Steve (Gadget) Barnes
• Steven Silvester
• Surya Prakash Susarla
• Syed Shah
• Sylvain Corlay
• Thomas Aarholt
• Thomas Kluyver
• Tim
• Tim Head
• Tim Klever
• Tim Metzler
• Todd
• Tom Jorquera
• Tyler Makaro
• Vaibhav Sagar
• Victor
• Vidar Tonaas Fauske
• Vu Minh Tam
• Vít Tuček
• Will Costello
• Will Starms
1.5. Changelog 71
Jupyter Notebook Documentation, Release 7.0.0a5
• William Hosford
• Xiaohan Li
• Yuvi Panda
• ashley teoh
• nullptr
1.5.29 5.7.8
• Fix regression in restarting kernels in 5.7.5. The restart handler would return before restart was completed.
• Further improve compatibility with tornado 6 with improved checks for when websockets are closed.
• Fix regression in 5.7.6 on Windows where .js files could have the wrong mime-type.
• Fix Open Redirect vulnerability (CVE-2019-10255) where certain malicious URLs could redirect from the
Jupyter login page to a malicious site after a successful login. 5.7.7 contained only a partial fix for this issue.
1.5.30 5.7.6
5.7.6 contains a security fix for a cross-site inclusion (XSSI) vulnerability (CVE-2019–9644), where files at a known
URL could be included in a page from an unauthorized website if the user is logged into a Jupyter server. The fix
involves setting the X-Content-Type-Options: nosniff header, and applying CSRF checks previously on all non-
GET API requests to GET requests to API endpoints and the /files/ endpoint.
The attacking page is able to access some contents of files when using Internet Explorer through script errors, but this
has not been demonstrated with other browsers.
1.5.31 5.7.5
1.5.32 5.7.4
5.7.4 fixes a bug introduced in 5.7.3, in which the list_running_servers() function attempts to parse HTML files
as JSON, and consequently crashes (4284).
1.5.33 5.7.3
1.5.34 5.7.2
5.7.2 contains a security fix preventing malicious directory names from being able to execute javascript. CVE request
pending.
1.5.35 5.7.1
5.7.1 contains a security fix preventing nbconvert endpoints from executing javascript with access to the server API.
CVE request pending.
1.5.36 5.7.0
New features:
• Update to CodeMirror to 5.37, which includes f-string syntax for Python 3.6 (3816)
• Update jquery-ui to 1.12 (3836)
• Check Host header to more securely protect localhost deployments from DNS rebinding. This is a pre-
emptive measure, not fixing a known vulnerability (3766). Use .NotebookApp.allow_remote_access and
.NotebookApp.local_hostnames to configure access.
• Allow access-control-allow-headers to be overridden (3886)
• Allow configuring max_body_size and max_buffer_size (3829)
• Allow configuring get_secure_cookie keyword-args (3778)
• Respect nbconvert entrypoints as sources for exporters (3879)
• Include translation sources in source distributions (3925, 3931)
• Various improvements to documentation (3799, 3800, 3806, 3883, 3908)
Fixing problems:
• Fix breadcrumb link when running with a base url (3905)
• Fix possible type error when closing activity stream (3907)
• Disable metadata editing for non-editable cells (3744)
• Fix some styling and alignment of prompts caused by regressions in 5.6.0.
• Enter causing page reload in shortcuts editor (3871)
• Fix uploading to the same file twice (3712)
See the 5.7 milestone on GitHub for a complete list of pull requests involved in this release.
Thanks to the following contributors:
• Aaron Hall
• Benjamin Ragan-Kelley
• Bill Major
• bxy007
• Dave Aitken
• Denis Ledoux
• Félix-Antoine Fortin
1.5. Changelog 73
Jupyter Notebook Documentation, Release 7.0.0a5
• Gabriel
• Grant Nestor
• Kevin Bates
• Kristian Gregorius Hustad
• M Pacer
• Madicken Munk
• Maitiu O Ciarain
• Matthias Bussonnier
• Michael Boyle
• Michael Chirico
• Mokkapati, Praneet(ES)
• Peter Parente
• Sally Wilsak
• Steven Silvester
• Thomas Kluyver
• Walter Martin
1.5.37 5.6.0
New features:
• Execute cells by clicking icon in input prompt (3535, 3687)
• New “Save as” menu option (3289)
• When serving on a loopback interface, protect against DNS rebinding by checking the Host header from the
browser (3714). This check can be disabled if necessary by setting NotebookApp.allow_remote_access.
(Disabled by default while we work out some Mac issues in 3754).
• Add kernel_info_timeout traitlet to enable restarting slow kernels (3665)
• Add custom_display_host config option to override displayed URL (3668)
• Add /metrics endpoint for Prometheus Metrics (3490)
• Update to MathJax 2.7.4 (3751)
• Update to jQuery 3.3 (3655)
• Update marked to 0.4 (3686)
Fixing problems:
• Don’t duplicate token in displayed URL (3656)
• Clarify displayed URL when listening on all interfaces (3703)
• Don’t trash non-empty directories on Windows (3673)
• Include LICENSE file in wheels (3671)
• Don’t show “0 active kernels” when starting the notebook (3696)
Testing:
1.5.38 5.5.0
New features:
• The files list now shows file sizes (3539)
• Add a quit button in the dashboard (3004)
• Display hostname in the terminal when running remotely (3356, 3593)
• Add slides exportation/download to the menu (3287)
• Add any extra installed nbconvert exporters to the “Download as” menu (3323)
• Editor: warning when overwriting a file that is modified on disk (2783)
• Display a warning message if cookies are not enabled (3511)
• Basic __version__ reporting for extensions (3541)
• Add NotebookApp.terminals_enabled config option (3478)
• Make buffer time between last modified on disk and last modified on last save configurable (3273)
• Allow binding custom shortcuts for ‘close and halt’ (3314)
• Add description for ‘Trusted’ notification (3386)
• Add settings['activity_sources'] (3401)
• Add an output_updated.OutputArea event (3560)
Fixing problems:
• Fixes to improve web accessibility (3507)
• Fixed color contrast issue in tree.less (3336)
• Allow cancelling upload of large files (3373)
• Don’t clear login cookie on requests without cookie (3380)
• Don’t trash files on different device to home dir on Linux (3304)
• Clear waiting asterisks when restarting kernel (3494)
• Fix output prompt when execution_count missing (3236)
1.5. Changelog 75
Jupyter Notebook Documentation, Release 7.0.0a5
• Make the ‘changed on disk’ dialog work when displayed twice (3589)
• Fix going back to root directory with history in notebook list (3411)
• Allow defining keyboard shortcuts for missing actions (3561)
• Prevent default on pageup/pagedown when completer is active (3500)
• Prevent default event handling on new terminal (3497)
• ConfigManager should not write out default values found in the .d directory (3485)
• Fix leak of iopub object in activity monitoring (3424)
• Javascript lint in notebooklist.js (3409)
• Some Javascript syntax fixes (3294)
• Convert native for loop to Array.forEach() (3477)
• Disable cache when downloading nbconvert output (3484)
• Add missing digestmod arg to HMAC (3399)
• Log OSErrors failing to create less-critical files during startup (3384)
• Use powershell on Windows (3379)
• API spec improvements, API handler improvements (3368)
• Set notebook to dirty state after change to kernel metadata (3350)
• Use CSP header to treat served files as belonging to a separate origin (3341)
• Don’t install gettext into builtins (3330)
• Add missing import _ (3316, 3326)
• Write notebook.json file atomically (3305)
• Fix clicking with modifiers, page title updates (3282)
• Upgrade jQuery to version 2.2 (3428)
• Upgrade xterm.js to 3.1.0 (3189)
• Upgrade moment.js to 2.19.3 (3562)
• Upgrade CodeMirror to 5.35 (3372)
• “Require” pyzmq>=17 (3586)
Documentation:
• Documentation updates and organisation (3584)
• Add section in docs about privacy (3571)
• Add explanation on how to change the type of a cell to Markdown (3377)
• Update docs with confd implementation details (3520)
• Add more information for where jupyter_notebook_config.py is located (3346)
• Document options to enable nbextensions in specific sections (3525)
• jQuery attribute selector value MUST be surrounded by quotes (3527)
• Do not execute special notebooks with nbsphinx (3360)
• Other minor fixes in 3288, 3528, 3293, 3367
Testing:
• Testing with Selenium & Sauce labs (3321)
• Selenium utils + markdown rendering tests (3458)
• Convert insert cell tests to Selenium (3508)
• Convert prompt numbers tests to Selenium (3554)
• Convert delete cells tests to Selenium (3465)
• Convert undelete cell tests to Selenium (3475)
• More selenium testing utilities (3412)
• Only check links when build is trigger by Travis Cron job (3493)
• Fix Appveyor build errors (3430)
• Undo patches in teardown before attempting to delete files (3459)
• Get tests running with tornado 5 (3398)
• Unpin ipykernel version on Travis (3223)
Thanks to the following contributors:
• Arovit Narula (arovit)
• Ashley Teoh (ashleytqy)
• Nicholas Bollweg (bollwyvl)
• Alex Rothberg (cancan101)
• Celina Kilcrease (ckilcrease)
• dabuside (dabuside)
• Damian Avila (damianavila)
• Dana Lee (danagilliann)
• Dave Hirschfeld (dhirschfeld)
• Heng GAO (ehengao)
• Leo Gallucci (elgalu)
• Evan Van Dam (evandam)
• forbxy (forbxy)
• Grant Nestor (gnestor)
• Ethan T. Hendrix (hendrixet)
• Miro Hrončok (hroncok)
• Paul Ivanov (ivanov)
• Darío Hereñú (kant)
• Kevin Bates (kevin-bates)
• Maarten Breddels (maartenbreddels)
• Michael Droettboom (mdboom)
• Min RK (minrk)
1.5. Changelog 77
Jupyter Notebook Documentation, Release 7.0.0a5
• M Pacer (mpacer)
• Peter Parente (parente)
• Paul Masson (paulmasson)
• Philipp Rudiger (philippjfr)
• Mac Knight (Shels1909)
• Hisham Elsheshtawy (Sheshtawy)
• Simon Biggs (SimonBiggs)
• Sunil Hari (@sunilhari)
• Thomas Kluyver (takluyver)
• Tim Klever (tklever)
• Gabriel Ruiz (unnamedplay-r)
• Vaibhav Sagar (vaibhavsagar)
• William Hosford (whosford)
• Hong (xuhdev)
See the 5.5 milestone on GitHub for a complete list of pull requests involved in this release.
1.5.39 5.4.1
1.5.40 5.4.0
• Fix creating files and folders after navigating directories in the dashboard (3264).
• Enable printing notebooks in colour, removing the CSS that made everything black and white (3212).
• Limit the completion options displayed in the notebook to 1000, to avoid performance issues with very long lists
(3195).
• Accessibility improvements in tree.html (3271).
• Added alt-text to the kernel logo image in the notebook UI (3228).
• Added a test on Travis CI to flag if symlinks are accidentally introduced in the future. This should prevent the
issue that necessitated release-5.3.1{.interpreted-text role=”ref”} (3227).
• Use lowercase letters for random IDs generated in our Javascript (3264).
• Removed duplicate code setting TextCell.notebook (3256).
Thanks to the following contributors:
• Alex Soderman (asoderman)
• Matthias Bussonnier (Carreau)
• Min RK (minrk)
• Nitesh Sawant (ns23)
1.5.41 5.3.1
Replaced a symlink in the repository with a copy, to fix issues installing on Windows (3220).
1.5.42 5.3.0
This release introduces a couple noteable improvements, such as terminal support for Windows and support for OS
trash (files deleted from the notebook dashboard are moved to the OS trash vs. deleted permanently).
• Add support for terminals on windows (3087).
• Add a “restart and run all” button to the toolbar (2965).
• Send files to os trash mechanism on delete (1968).
• Allow programmatic copy to clipboard (3088).
• Use DOM History API for navigating between directories in the file browser (3115).
• Add translated files to folder(docs-translations) (3065).
• Allow non empty dirs to be deleted (3108).
• Set cookie on base_url (2959).
• Allow token-authenticated requests cross-origin by default (2920).
• Change cull_idle_timeout_minimum to 1 from 300 (2910).
• Config option to shut down server after n seconds with no kernels (2963).
• Display a “close” button on load notebook error (3176).
• Add action to command pallette to run CodeMirror’s “indentAuto” on selection (3175).
• Add option to specify extra services (3158).
• Warn_bad_name should not use global name (3160).
• Avoid overflow of hidden form (3148).
• Fix shutdown trans loss (3147).
• Find available kernelspecs more efficiently (3136).
• Don’t try to translate missing help strings (3122).
• Frontend/extension-config: allow default json files in a .d directory (3116).
• Use [requirejs]{.title-ref} vs. [require]{.title-ref} (3097).
• Fixes some ui bugs in firefox #3044 (3058).
• Compare non-specific language code when choosing to use arabic numerals (3055).
• Fix save-script deprecation (3053).
• Include moment locales in package_data (3051).
• Fix moment locale loading in bidi support (3048).
1.5. Changelog 79
Jupyter Notebook Documentation, Release 7.0.0a5
1.5.43 5.2.1
1.5.44 5.2.0
1.5. Changelog 81
Jupyter Notebook Documentation, Release 7.0.0a5
1.5.45 5.1.0
1.5.46 5.0.0
This is the first major release of the Jupyter Notebook since version 4.0 was created by the “Big Split” of IPython and
Jupyter.
We encourage users to start trying JupyterLab in preparation for a future transition.
We have merged more than 300 pull requests since 4.0. Some of the major user-facing changes are described here.
Files in the dashboard may now be sorted by last modified date or name (943):
Cell tags
Table style
The default styling for tables in the notebook has been updated (1776).
You can now edit keyboard shortcuts for Command Mode within the UI (1347):
See the Help > Edit Keyboard Shortcuts menu item and follow the instructions.
Other additions
• You can copy and paste cells between notebooks, using Ctrl-C{.interpreted-text role=”kbd”} and
Ctrl-V{.interpreted-text role=”kbd”} (Cmd-C{.interpreted-text role=”kbd”} and Cmd-V{.interpreted-text
role=”kbd”} on Mac).
• It’s easier to configure a password for the notebook with the new jupyter notebook password command
(2007).
• The file list can now be ordered by last modified or by name (943).
• Markdown cells now support attachments. Simply drag and drop an image from your desktop to a markdown
cell to add it. Unlike relative links that you enter manually, attachments are embedded in the notebook itself. An
unreferenced attachment will be automatically scrubbed from the notebook on save (621).
• Undoing cell deletion now supports undeleting multiple cells. Cells may not be in the same order as before their
deletion, depending on the actions you did on the meantime, but this should should help reduce the impact of
accidentally deleting code.
• The file browser now has Edit and View buttons.
• The file browser now supports moving multiple files at once (1088).
1.5. Changelog 83
Jupyter Notebook Documentation, Release 7.0.0a5
• The Notebook will refuse to run as root unless the --allow-root flag is given (1115).
• Keyboard shortcuts are now declarative (1234).
• Toggling line numbers can now affect all cells (1312).
• Add more visible Trusted and Untrusted notifications (1658).
• The favicon (browser shortcut icon) now changes to indicate when the kernel is busy (1837).
• Header and toolbar visibility is now persisted in nbconfig and across sessions (1769).
• Load server extensions with ConfigManager so that merge happens recursively, unlike normal config values, to
make it load more consistently with frontend extensions(2108).
• The notebook server now supports the bundler API from the jupyter_cms incubator project (1579).
• The notebook server now provides information about kernel activity in its kernel resource API (1827).
Remember that upgrading notebook only affects the user interface. Upgrading kernels and libraries may also provide
new features, better stability and integration with the notebook interface.
1.5.47 4.4.0
• Allow override of output callbacks to redirect output messages. This is used to implement the ipywidgets Output
widget, for example.
• Fix an async bug in message handling by allowing comm message handlers to return a promise which halts
message processing until the promise resolves.
See the 4.4 milestone on GitHub for a complete list of issues and pull requests involved in this release.
1.5.48 4.3.2
4.3.2 is a patch release with a bug fix for CodeMirror and improved handling of the “editable” cell metadata field.
• Monkey-patch for CodeMirror that resolves #2037 without breaking #1967
• Read-only ("editable": false) cells can be executed but cannot be split, merged, or deleted
See the 4.3.2 milestone on GitHub for a complete list of issues and pull requests involved in this release.
1.5.49 4.3.1
4.3.1 is a patch release with a security patch, a couple bug fixes, and improvements to the newly-released token authen-
tication.
Security fix:
• CVE-2016-9971. Fix CSRF vulnerability, where malicious forms could create untitled files and start kernels
(no remote execution or modification of existing files) for users of certain browsers (Firefox, Internet Explorer /
Edge). All previous notebook releases are affected.
Bug fixes:
• Fix carriage return handling
• Make the font size more robust against fickle browsers
• Ignore resize events that bubbled up and didn’t come from window
• Add Authorization to allowed CORS headers
1.5.50 4.3.0
4.3 is a minor release with many bug fixes and improvements. The biggest user-facing change is the addition of token
authentication, which is enabled by default. A token is generated and used when your browser is opened automatically,
so you shouldn’t have to enter anything in the default circumstances. If you see a login page (e.g. by switching browsers,
or launching on a new port with --no-browser), you get a login URL with the token from the command jupyter
notebook list, which you can paste into your browser.
Highlights:
• API for creating mime-type based renderer extensions using OutputArea.register_mime_type and
Notebook.render_cell_output methods. See mimerender-cookiecutter for reference implementations and
cookiecutter.
• Enable token authentication by default. See server_security{.interpreted-text role=”ref”} for more details.
• Update security docs to reflect new signature system
• Switched from term.js to xterm.js
Bug fixes:
• Ensure variable is set if exc_info is falsey
• Catch and log handler exceptions in events.trigger
• Add debug log for static file paths
• Don’t check origin on token-authenticated requests
• Remove leftover print statement
• Fix highlighting of Python code blocks
• json_errors should be outermost decorator on API handlers
• Fix remove old nbserver info files
• Fix notebook mime type on download links
• Fix carriage symbol behavior
• Fix terminal styles
• Update dead links in docs
• If kernel is broken, start a new session
• Include cross-origin check when allowing login URL redirects
Other improvements:
• Allow JSON output data with mime type application/*+json
• Allow kernelspecs to have spaces in them for backward compat
• Allow websocket connections from scripts
1.5. Changelog 85
Jupyter Notebook Documentation, Release 7.0.0a5
1.5.51 4.2.3
1.5.52 4.2.2
4.2.2 is a small bugfix release on 4.2, with an important security fix. All users are strongly encouraged to upgrade to
4.2.2.
Highlights:
• Security fix: CVE-2016-6524, where untrusted latex output could be added to the page in a way that could
execute javascript.
• Fix missing POST in OPTIONS responses.
• Fix for downloading non-ascii filenames.
• Avoid clobbering ssl_options, so that users can specify more detailed SSL configuration.
• Fix inverted load order in nbconfig, so user config has highest priority.
• Improved error messages here and there.
1.5.53 4.2.1
1.5.54 4.2.0
Release 4.2 adds a new API for enabling and installing extensions. Extensions can now be enabled at the system-level,
rather than just per-user. An API is defined for installing directly from a Python package, as well.
Highlighted changes:
• Upgrade MathJax to 2.6 to fix vertical-bar appearing on some equations.
• Restore ability for notebook directory to be root (4.1 regression)
• Large outputs are now throttled, reducing the ability of output floods to kill the browser.
• Fix the notebook ignoring cell executions while a kernel is starting by queueing the messages.
• Fix handling of url prefixes (e.g. JupyterHub) in terminal and edit pages.
• Support nested SVGs in output.
And various other fixes and improvements.
1.5.55 4.1.0
Bug fixes:
• Properly reap zombie subprocesses
• Fix cross-origin problems
• Fix double-escaping of the base URL prefix
• Handle invalid unicode filenames more gracefully
• Fix ANSI color-processing
• Send keepalive messages for web terminals
• Fix bugs in the notebook tour
UI changes:
• Moved the cell toolbar selector into the View menu. Added a button that triggers a “hint” animation to the main
toolbar so users can find the new location. (Click here to see a screencast )
• Added Restart & Run All to the Kernel menu. Users can also bind it to a keyboard shortcut on action
restart-kernel-and-run-all-cells.
• Added multiple-cell selection. Users press Shift-Up/Down or Shift-K/J to extend selection in command
mode. Various actions such as cut/copy/paste, execute, and cell type conversions apply to all selected cells.
• Added a command palette for executing Jupyter actions by name. Users press Cmd/Ctrl-Shift-P or click the
new command palette icon on the toolbar.
• Added a Find and Replace dialog to the Edit menu. Users can also press F in command mode to show the dialog.
1.5. Changelog 87
Jupyter Notebook Documentation, Release 7.0.0a5
Other improvements:
• Custom KernelManager methods can be Tornado coroutines, allowing async operations.
• Make clearing output optional when rewriting input with set_next_input(replace=True).
• Added support for TLS client authentication via --NotebookApp.client-ca.
• Added tags to jupyter/notebook releases on DockerHub. latest continues to track the master branch.
See the 4.1 milestone on GitHub for a complete list of issues and pull requests handled.
1.5.56 4.0.x
4.0.6
4.0.5
4.0.4
4.0.2
4.0.0
TWO
CONFIGURATION
Beyond the default configuration settings, you can configure a rich array of options to suit your workflow. Here are
areas that are commonly configured when using Jupyter Notebook:
• Jupyter’s common configuration system
• Jupyter Server
• Notebook extensions
Let’s look at highlights of each area.
Jupyter applications, from the Notebook to JupyterHub to nbgrader, share a common configuration system. The process
for creating a configuration file and editing settings is similar for all the Jupyter applications.
• Jupyter’s Common Configuration Approach
• Common Directories and File Locations
• Language kernels
• traitlets provide a low-level architecture for configuration.
The Jupyter Server runs the language kernel and communicates with the front-end Notebook client (i.e. the familiar
notebook interface).
• Configuring the Jupyter Server
To create a jupyter_server_config.py file in the .jupyter directory, with all the defaults com-
mented out, use the following command:
89
Jupyter Notebook Documentation, Release 7.0.0a5
Certain subsystems of the notebook server are designed to be extended or overridden by users. These documents explain
these systems, and show how to override the notebook’s defaults with your own custom behavior.
This describes the basic steps to write a TypeScript extension for the Jupyter notebook front-end. This allows you to
customize the behaviour of the various pages like the dashboard, the notebook, or the text editor.
Starting with Notebook v7, front-end extensions for the notebook can be developed as prebuilt JupyterLab extensions.
This means Notebook v7 is able to reuse many of the existing extensions from the JupyterLab ecosystem as is.
If you would like to develop a prebuilt extension for Notebook v7, check out:
• JupyterLab Extension Tutorial: A tutorial to learn how to make a simple JupyterLab extension.
• The JupyterLab Extension Examples Repository: A short tutorial series to learn how to develop extensions for
JupyterLab by example.
90 Chapter 2. Configuration
CHAPTER
THREE
CONTRIBUTOR
jlpm build
There is also a watch script to watch for changes and rebuild the app automatically:
jlpm watch
91
Jupyter Notebook Documentation, Release 7.0.0a5
jupyter notebook
There are also end to end tests to cover higher level user interactions, located in the ui-tests folder. To run these
tests:
cd ui-tests
# start a new Jupyter server in a terminal
jlpm start
The test script calls the Playwright test runner. You can pass additional arguments to playwright by appending
parameters to the command. For example to run the test in headed mode, jlpm test --headed.
Checkout the Playwright Command Line Reference for more information about the available command line options.
Running the end to end tests in headful mode will trigger something like the following:
All non-python source code is formatted using prettier and python source code is formatted using blacks When code is
modified and committed, all staged files will be automatically formatted using pre-commit git hooks (with help from
pre-commit. The benefit of using a code formatters like prettier and black is that it removes the topic of code style
from the conversation when reviewing pull requests, thereby speeding up the review process.
As long as your code is valid, the pre-commit hook should take care of how it should look. pre-commit and its
associated hooks will automatically be installed when you run pip install -e ".[dev,test]"
To install pre-commit manually, run the following:
92 Chapter 3. Contributor
Jupyter Notebook Documentation, Release 7.0.0a5
You can invoke the pre-commit hook by hand at any time with:
pre-commit run
which should run any autoformatting on your code and tell you about any errors it couldn’t fix automatically. You may
also install black integration into your text editor to format code automatically.
If you have already committed files before setting up the pre-commit hook with pre-commit install, you can fix
everything up using pre-commit run --all-files. You need to make the fixing commit yourself after that.
You may also use the prettier npm script (e.g. npm run prettier or yarn prettier or jlpm prettier) to format
the entire code base. We recommend installing a prettier extension for your code editor and configuring it to format
your code with a keyboard shortcut or automatically on save.
Some of the hooks only run on CI by default, but you can invoke them by running with the --hook-stage manual
argument.