Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / Python

Install Jupyter Notebook on Ubuntu

3.67/5 (2 votes)
10 Sep 2020CPOL 14.8K  
How to get Jupyter Notebook running on Ubuntu 20.04
In this post, we will go through the steps to get Jupyter Notebook running on Ubuntu 20.04.

Introduction

I’m using Ubuntu 20.04 server, I have XFCE installed.

What We’ll Cover

  1. Setup Python
  2. Create Python Virtual Environment
  3. Install Jupyter
  4. Run Jupyter Notebook
  5. Create Jupyter in Application Menu

1. Setup Python

sudo apt-get update && sudo apt-get upgrade
sudo apt install python3-pip python3-dev

Upgrade pip and Install the Package by Typing

sudo -H pip3 install --upgrade pip
sudo -H pip3 install virtualenv

2. Create Python Virtual Environment

Create a Directory to Put Our Virtual Environment

mkdir code

Create Python Virtual Environment

cd code
virtualenv jupyterenvironment 

Load Created Virtual Environment

source jupyterenvironment/bin/activate 

3. Install Jupyter

pip install jupyter

Install nbconvert

pip install nbconvert

4. Run Jupyter Notebook

jupyter notebook

Install pandoc & Latex to Allow for PDF Export

sudo apt-get install pandoc
sudo apt-get install texlive-xetex texlive-fonts-recommended

5. Create Jupyter in Application Menu

Create Script to Run jupyter

Create a file called run-jupyter.sh.

Bash
#!/bin/bash

source /home/username/jupyterenvironment/bin/activate
jupyter notebook

Create Applications Menu Item

Create a file in /usr/share/applications called jupyter.desktop.

[Desktop Entry]
Name=Jupyter Notebook
Exec=/home/username/jupyterenvironment/run-jupyter.sh
Type=Application
Terminal=true

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)