How to install Jupyter Notebook on Ubuntu 18.04/ 20.04 to practice Python, Julia, R, Haskell, and Ruby. This article will guide you on how to install Jupyter Notebook on Ubuntu 20.04 LTS. Here we show you very simple ways to install Jupyter on Ubuntu 20.04 LTS or other Ubuntu-based Linux Distributions. You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint, Elementary OS, Zorin OS, and POP! OS.
Table of Contents
- Install Jupyter Notebook on Ubuntu
- Step 1. Update and Upgrade Packages
- Step 2. Install Python virtualenv
- Step 3. Create Python Virtual Environment
- Step 4. Install Jupyter Notebook
- Step 5. Run Jupyter Notebook
- How do I run a Jupyter Notebook in Ubuntu?
- Step 6. Create Jupyter Application Menu.
Jupyter is an open-source web application, and it is used primarily for working with data, statistical modeling, and machine learning. It lets you create and share interactive code, visualizations, etc. Jupyter is a next-generation notebook interface, and it can be used with several programming languages, like Python, R, Haskell, Julia, Ruby, and Scala.
Install Jupyter Notebook on Ubuntu
The following steps are to install Jupyter Notebook on your Ubuntu systems.
Step 1. Update and Upgrade Packages
Run the following command to update available packages and their versions. And the upgrade command to install newer versions of the packages.
sudo apt update && sudo apt -y upgrade
Step 2. Install Python virtualenv
We can use Python’s virtual environment to manage our projects. We will install Jupyter into this virtual environment.
pip version and install Python
virtualenv package by typing:
sudo -H pip3 install --upgrade pip
sudo -H pip3 install virtualenv
Step 3. Create Python Virtual Environment
After installing virtualenv, let’s start forming our environment. Let’s create a directory in your home directory (or any other location).
Now let’s go to the notebook directory and create a Python virtual environment called
Now we have to activate the virtual environment.
Step 4. Install Jupyter Notebook
With your virtual environment active, install Jupyter by the following command.
pip install jupyter
Step 5. Run Jupyter Notebook
Now you have everything you need to run Jupyter Notebook, run Jupyther buy the following command:
How do I run a Jupyter Notebook in Ubuntu?
To launch Jupyter Notebook:
- Open your terminal window
- Go to your notebook directory or you can simply follow
- Activate virtualenv command:
- Start Jupyter Notebook command:
Step 6. Create Jupyter Application Menu.
Now create a new file called
run-jupyter.sh in your Jupter notebook directory:
The next step is to go to the
/usr/share/applications directory and create a file named
jupyter.desktop with the code below to create an application menu item:
Congratulations! You have successfully installed Jupyter Notebokon your ubuntu system. Thanks for using this tutorial to install Jupyter Notebook on Ubuntu 20.04 LTS system. For additional help or useful information, we recommend you check the official Jupyter website.