til

Virtual environment setup

Upgrade pip.

python3 -m pip install --upgrade pip

Create a base folder to store the virtual environments in.

mkdir ~/.venv

Create a new virtual environment.

python3 -m venv ~/.venv/venv

Activate the virtual environment.

source ~/.venv/venv/bin/activate

Install ipykernel.

python3 -m pip install ipykernel

Add the new kernel.

ipython kernel install --name=venv --user

TL;DR

python3 -m pip install --upgrade pip
mkdir ~/.venv
python3 -m venv ~/.venv/venv
source ~/.venv/venv/bin/activate
python3 -m pip install ipykernel
ipython kernel install --name=venv --user