Add jupyter kernel from notebook
- Create virtual env using venv
python -m venv venv
or using virutalenv
virtualenv venv
- Install ipykernel to comunicate with jupyter notebook
./venv/bin/pip install ipykernel
- Add venv to jupter notebook kernel
python -m ipykernel install --user --name=venv
- 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"