65.9K
CodeProject is changing. Read more.
Home

Install Jupyter Notebook on Ubuntu

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.67/5 (2 votes)

Sep 10, 2020

CPOL
viewsIcon

14799

How 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.

#!/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