Skip to main content

Jupyter Notebook

228 words·
Jupyter Notebook Python pip venv
Table of Contents

Quick tutorial on setting up Jupyter Notebook for both local and remote access.

Jupyter Notebook
#

Install Python3
#

# Update Package Manager
sudo apt update

#Install Python3
sudo apt install python3

# Check Version
python3 --version

Install pip
#

# Install Pip (Python Package Manager)
sudo apt install python3-pip

# Check Version
pip3 --version

pip Commands
#

# Install Package: 
pip install package-name

#Upgrade Package: 
pip install --upgrade package-name

#Uninstall Package: 
pip uninstall package-name

#List installed packages: 
pip list

Python venv
#

Venv allows to create isolated Python environments.

# Install Python venv
sudo apt install python3-venv

# Check
virtualenv --version

Create a virtual environment

# Navigate into directory where the Virtual Environment should be created
cd python

# Create Virtual Environment
python3 -m venv python-env # Replace python-env with the name for your environment

# List the newly created virtual environment
ls
# Shell output
python-env

# Activate the Virtual Environment
source python-env/bin/activate # Replace python-env with the name for your environment

# Deactivate the environment: Return to normal shell
deactivate

# Remove Virtual Environment
rm -r python-env

Install Jupyter Notebook
#

# Install IPython kernel for Jupyter
pip install ipykernel

# Install Jupyter Notebook
pip install notebook


# Start Jupyter Notebook: Accept connections from local host
jupyter notebook

# Start Jupyter Notebook: Accept all connections
jupyter notebook --ip=0.0.0.0

# Stop Jupyter Notebook
`Strg` + `C