Jupyter Notebook - ankit-jha/commands GitHub Wiki

Help Commands

Shift-Tab #Quick reference

Shift-Tab-Tab #Full Documentation

Shift-Tab-Tab-Tab #The tooltip will linger for 10 seconds while you type

Shift-Tab-Tab-Tab-Tab #The docstring appears in the pager (small part at the bottom of the window) and stays there.

Setting Up Jupyter Server

  • starting with an Ubuntu m/c with python3 installed
  • sudo apt-get install python3-pip
  • apt-get install virtualenv
  • virtualenv --python=python3 env
  • python3 -m pip install -U jupyter matplotlib numpy pandas scipy scikit-learn
  • jupyter notebook --generate-config
  • jupyter notebook password (also used to change the password)
  • nohup mkdir -p /opt/notebooks && jupyter notebook --notebook-dir=/opt/notebooks --ip='0.0.0.0' --port=8888 --no-browser --allow-root &> $(date +"%Y%m%dT%H%M%S")jupyter.log &
  • jupyter notebook stop [8888]

Managing Jupyter Kernels

Add the virtualenv as a jupyter kernel

  • Activate the virtualenv source your-venv/bin/activate
  • Install jupyter in the virtualenv pip install jupyter
  • Add the virtualenv as a jupyter kernel ipython kernel install --name "local-venv" --user
  • Directly add virtualenv as a jupyter kernel python -m ipykernel install --user --name <local-venv> --display-name "<name-of-your-kernel>"

List Kernels

  • jupyter kernelspec list

Remove Kernel

  • jupyter kernelspec remove <kernel-name>

Change Kernel Name

  • Use jupyter kernelspec list to see the folder the kernel is located in

  • In that folder, open up file kernel.json and edit option "display_name"

⚠️ **GitHub.com Fallback** ⚠️