Jupyter Notebook: How to Install and Use

Learn about Jupyter Notebook, part of the Jupyter Lab interactive IDE that is ideal for Data Science. We’ll explore the advantages of using it over a regular IDE, show you how to install Jupyter Notebook and Jupyter Lab, and demonstrate its abilities.

Jupyter Lab vs Jupyter Notebook

JupyterLab is a web-based, interactive development environment. It’s most well known for offering a so-called notebook called Jupyter Notebook, but you can also use it to create and edit other files, like code, text files, and markdown files. In addition, it allows you to open a Python terminal, as most IDEs do, to experiment and tinker.

JupyterLab is flexible: you can configure and arrange the user interface to support a wide range of workflows in data science, scientific computing, and machine learning. It’s also extensible: everyone can write plugins that add new components and integrate with existing ones.

JupyterLab supports over 40 other programming languages, like Java, Scala, Julia, and R. However, I’ll focus solely on Python in this article.

On the other hand, Jupyter Notebook is a REPL-like environment that fuses code, data, and documentation. So in short, JupyterLab is the browser-based IDE, while Jupyter Notebook is the Notebook component inside it. You can install Jupyter Notebook separately if you want, and I’ll show you how in this article.

Advantages of using Jupyter Lab and Notebook

Python application developers often prefer and work with a regular Python IDE like VSCode, which facilitates debugging, unit testing, deployment, and version management. In contrast, (data) scientists and data analysts have a different focus and often prefer a Notebook-style IDE. Let’s look at some of the advantages these notebooks have to offer.

Combine and document code and results

The biggest advantage of using notebooks is that it allows you to combine three things into one environment:

  1. documentation,
  2. code,
  3. results

All the while offering an interactive environment where you or your fellows can tinker and experiment. The following image perfectly demonstrated this:

A Jupyter notebook combining documentation, output, and code

Interactive exploration

A Notebook allows you to explore your data interactively. While doing so, the Notebook is a log of what you did and how you did it. It’s ideal to use in combination with NumPy and Pandas. So a Notebook is much more geared toward those working with and analyzing data than regular IDEs. However, some IDEs, like VSCode, will offer a built-in Jupyter Notebook (see further down this article).

It’s what the others use

Sometimes it helps to go with the flow. In this case, you’ll notice that many others in data science use Jupyter Notebooks. This has a couple of advantages on its own:

  • It’s easy to exchange and share your work.
  • Many plugins are created by fellow data scientists, specifically targeted at people like you.

How to install Jupyter Notebook and Lab

Like all Python software, installing Jupyter Lab is a breeze. I’ll demonstrate how to install with both Pip and Conda. One thing to note beforehand: I recommend installing this system-wide. With most packages, I’m stressing the importance of using a virtual environment. However, tools like this you want to install once.

Install Jupyter Lab and/or Notebook with Pip

As noted above, you want to install Jupyter Lab system-wide, or at least in your local bin folder. Installing the package globally with Pip requires the -g option. On many Linux systems, however, Pip will install the package in a .local/bin folder if you don’t specify -g and if you’re not using a virtual environment. You can force this behavior by using the --user option. The advantage is that you don’t need root access to the system you’re working on.

So, the most recommended way to install Jupyter Lab is to use the pip install command:

$ pip install --user jupyterlab

If you only want Jupyter Notebook, use this instead:

$ pip install --user notebook

Install JupyterLab with Conda

JupyterLab can be installed with mamba and conda as well:

$ mamba install -c conda-forge jupyterlab


$ conda install -c conda-forge jupyterlab

Like with Pip, if you only want o install Jupyter Notebook, use this:

$ mamba install -c conda-forge notebook


$ conda install -c conda-forge notebook

Start and explore JupyterLab

How to open Jupyter lab from the command-line

If you followed the installation instructions, you should be able to start Jupyter Lab with:

$ jupyter-lab

(a bunch of log message will follow)

How to open Jupyter Notebook from the command-line

If you only want to start a Notebook, use this:

$ jupyter-notebook

(a bunch of log message will follow)

Adding to your PATH

If you get an error like “command not found”, don’t panic just yet. Unfortunately, some systems don’t have the .local/bin directory in the $PATH variable. On Linux and OS X, a quick fix is to add it temporarily like this:


However, this will only work as long as you keep the terminal window open. So, to make this permanent, I recommend adding the following snippet to the end of your ~/.profile file:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then

All it does, is add the .local/bin folder to the PATH, but only if it actually exists.

The .profile file is loaded once when you login to your system. You you probably need to logout and login to apply the changes. In case you use zsh instead of Bash (zsh is the default on MacOS these days), you may want to try adding the snippet about to a file called .zprofile instead.

Your first steps in a Notebook

If you start Jupyter Lab or Notebook, it will automatically open your browser. If it didn’t, you can go to http://localhost:8888/ manually to open it. Once there, create a new Notebook, e.g. by clicking File -> New -> Notebook.

In the following screenshot, I created a new Notebook named ‘First steps’. There are a couple of noteworthy things to see:

  • Your input is place in a ‘cell’, and each cell is numbered
  • You can access the previous cells by using the In and Out arrays. E.g., Out[3] in the example below gives us the output of the expression in the In[3] cell
  • You can also change the cell type to Markdown, for more on this, see below
  • If you want to apply or execute your cell, press Shift + Enter.
A simple Jupyter Notebook

Cell types

At the top of your notebook, there is a dropdown that allows you to change the cell type. All you need to care about for now, are the types ‘Python’ and ‘Markdown’.


A Python cell contains Python code. This can be any valid code, so all these are allowed:


Markdown is a lightweight markup language for creating formatted text. You can use it to create headers, lists, code snippets, and most other things you can think of. You might be familiar with it if you ever created a README.md file on GitHub, for example.

Markdown is great for adding documentation to your notebook. For most, the use of a Markdown cheat sheet is enough to get started quickly.


You can enter nice-looking formulas using Markdown as well. Internally, Jupyter uses MathJax to format and display formulas. A formula starts and ends with either a single or a double dollar sign:

  • $ .... $: in-line; the formula is in line with the rest of the current sentence
  • $$ .. $$: display mode; the formula stands out from the rest of the text

Inside, you need to enter a TeX-based equation. If you want to see all the options and play around with such equations, I recommend this website that offers a Tex equation editor.

JupyterLab plugins

If you click on the puzzle icon at the left of the screen, you’ll get a list of plugins that can be installed directly. There are lots of plugins, and many of them will add extra visualization capabilities or integration with products like Tableau.


Internally, Jupyter Notebooks use a project called IPython. If you tend to use the Python REPL a lot, I recommend you to read our page on IPython since it is a great alternative to the regular REPL. I use it a lot personally, and I can’t recommend it enough! For example, it’s worth it just for its terrific auto-completion, and if you are used to Jupyter Notebooks, you’ll feel right at home, obviously.

IPython in action

Jupyter Notebook in VSCode

If you’re a VSCode fan, like me, you need to check out the VSCode extension that allows you to create and work with notebooks directly inside a VSCode tab. If you open up the command pallet, e.g. with ctrl + shift + p, start typing “Jupyter” to create, open, and export Notebooks.

Create a new Jupyter Notebook from VSCode
Create a new Jupyter Notebook from VSCode

Keep learning

It’s always worth visiting the official project website, for the latest news and documentation around Jupyter Lab and Jupyter Notebook.

Python Courses

Are you enjoying this free tutorial? Please also have a look at my premium courses. They offer a superior user experience with small, easy-to-digest lessons and topics, progress tracking, quizzes to test your knowledge, and practice sessions. Each course will earn you a downloadable course certificate.

The Python Fundamentals Course For Beginners
Now for $29 (from $49)

Python Fundamentals I is a course for beginners that will get you started with Python in no time. Learn all the essentials, test your progress with quizzes and assignments, and bring it all together with the final course project!

Python Course for Beginners

Modules, Packages, And Virtual Environments
Now for $29 (from $49)

Python Fundamentals II covers creating your own modules and packages, using virtual environments and Python package managers to make your life as a programmer easier. Advance your productivity as a Python programmer!

Python Fundamentals 2

2 thoughts on “Jupyter Notebook: How to Install and Use”

  1. Hi, Thanks for your site. I’ve been devouring it… So helpful!! Just wanted to mention that there’s a small typo on this page:

    $ pip install –user jupterlab

    should by jupyterlab.

Leave a Comment