This is suggested for very new users to use a stable environment.
It is NOT suitable for normal users / experienced programmers / engineers.

for windows

Download Python 3 from Anaconda and install.
From Windows "Start" menu, run "Jupyter" directly. (at least since v5.3.1)
Old versions needs to run from navigator as below:

anaconda for linux

Similar to win, for details, see here.

ubuntu 16

(for ubuntu 18, optioanlly remove apt ... ipython-notebook which is deprecated)

Add export PATH=$(echo $PATH | sed 's/\/opt\/conda\/bin//g') to the end of .bashrc, if you avoid conda which is already installed.

# install pip
sudo apt-get update && \
sudo apt-get -q install -y python3-pip && \
sudo pip3 install --upgrade pip ; sudo pip install --upgrade pip

# install jupyter & sci-kit
sudo apt-get install -y python-dev python3-dev ipython ipython-notebook && \
sudo -H pip install jupyter; sudo -H pip3 install jupyter && \
sudo -H pip3 install scipy numpy scikit-learn matplotlib pandas sympy nose ggplot

Now, jupyter-notebook uses py3 by default.

To add py2 into jupyter menu:(do NOT use py2 anymore!)

# sudo pip2 install --upgrade pip && \
sudo apt-get -q install -y python-pip && \
sudo python2 -m pip install ipykernel && \
sudo python2 -m ipykernel install --user

(if py3 is lost later for some reason, do the following):

sudo python3 -m pip install jupyter ipykernel
sudo python3 -m ipykernel install --user

ref: stackOverflow


When having py2, want py3 with jupyter:

pip3 install jupyter


  1. setup ssh tunnel (usually 8888): ssh-in-case-of > SSH Tunneling > port forwarding (jupyter exmaple).
  2. run jupyter-notebook in server ssh, will see some errors regarding X11 / javascript, ignore them.
  3. local browser localhost:80.


Mac: not displaying ggplot erros ref
Win: not displaying ggplot deep erros (ggplot >> aex() contains non-existing column name, rstudio can display errors.) (gpu workday >> 860_paper_plot.ipynb)


web (modified to: weidadeyue_jupyter-notebook-cheatsheet-shortcut.xlsx)
totally vim binding (with nix cmd)
for win, run the following: (though output ok, seems not working)

jupyter --data-dir
mkdir -p C:\Users\<user_name>\AppData\Roaming\jupyter\nbextensions
cd C:\Users\<user_name>\AppData\Roaming\jupyter\nbextensions
git clone vim_binding
jupyter nbextension enable vim_binding\vim_binding

+ pipenv kernels

To add pipenv based kernels, see ref.

For pipenv itself, see learning-python > pipenv & pyenv.

+ R (Original Way)

See also: install R.
WARN: MUST close other R sessions before installation to update necessary dependencies.
Step 1. install py 3. see: learning-python
Step 2. install jupyter pip3 install jupyter
Step 3. install r packages as below:
Firstly, some system dependencies:

sudo apt-get install -y libssl-dev libssh2-1-dev libcurl4-openssl-dev zlib1g-dev # Ubuntu only:

Then in R (by: sudo -i R)

# run cmd one by one
install.packages(c('devtools', 'digest', 'repr','devtools', 'digest', 'IRdisplay', 'crayon', 'pbdZMQ', 'devtools'))
IRkernel::installspec()  # to register the kernel in the current R installation

OBS: the last command should be done by each jupyter user in nix.
To install for more R installations, see IRkernel doc.
Step 4. run jupyter jupyter-notebook.exe

+ R (Anaconda Way)

Step 1. install anaconda3 (or miniconda) with py 3

  • install for only one user
  • do NOT add to system PATH (just keep default)

Step 2. install conda packages
conda install -c r ipython-notebook r-irkernel ipython notebook
Step 3. run
jupyter notebook
ref: Revolution Analytics .com

+ Julia

Step 1. install Julia
Step 2. install IJulia


Step 3. run

using IJulia


jupyter notebook

official github ref

julia + conda (not suggested)

conda has no IJulia support yet,
to install julia only:
conda install -c wakari1 julia=0.3.0.git_prerelease

w/ spark

see spark


JupyterHub on K8S


frequently used tools

supercharging jupyter notebooks

module auto-reload

In ipython notebook (ipynb), put the following code before importing the packages the should be auto-reloaded:

%load_ext autoreload
%autoreload 2

cell display width

from IPython.core.display import display, HTML
display(HTML("<style>.container { width:80% !important; }</style>")) # Set cell width equal to 'browser width'

pandas display

pd.options.display.max_rows = 6


Table of Contents


jupyter nbextension install --user
curl -L > $(jupyter --data-dir)/nbextensions/toc.css
jupyter nbextension enable toc


jupyter nbextension install --user

save this link as file: $(jupyter --data-dir)/nbextensions/toc.css

jupyter nbextension enable toc


Conda is a cross-language package management system, its binary packages are in a different path, not the system's python / R. It installs frequently used packages by default.
See more "Conda vs Anaconda vs Miniconda" & "Conda vs pip" here: