Add jupyter kernel from notebook

  1. Create virtual env using venv
python -m venv venv

or using virutalenv

virtualenv venv
  1. Install ipykernel to comunicate with jupyter notebook
./venv/bin/pip install ipykernel
  1. Add venv to jupter notebook kernel
python -m ipykernel install --user --name=venv
  1. check kernel creation
$ python -m ipykernel install --user --name=sensiml
/home/arch/.local/share/jupyter/kernels/sensiml
$ cat /home/arch/.local/share/jupyter/kernels/sensiml
{
 "argv": [
  "/home/arch/Documents/python/mypythonproject/venv/bin/python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "sensiml",
 "language": "python"
}

Jupyter tips

~/.ipython/profile_default/ipython_config.py with the lines below.

# Run all nodes interactively
c.InteractiveShell.ast_node_interactivity = "all"