Tour of the Jupyter (IPython3) notebook

Installing Jupyter

If you have not already done so, run

! pip install -U ipython

Installing other kernels

A list of kernels is maintained here

Bash

! pip install bash_kernel

R

Run this in your shell

sudo apt-get install libzmq3-dev libcurl4-openssl-dev

Run this in R

install.packages("devtools")
install.packages('RCurl')
library(devtools)
install_github('armstrtw/rzmq')
install_github('IRkernel/repr')
install_github('IRkernel/IRdisplay')
install_github('IRkernel/IRkernel')
IRkernel::installspec()

Julia

Download and install Julia. Then run this in Julia

Pkg.add("IJulia")

Octave

Install octave in your shell

sudo apt-get install octave
! pip install octave_kernel

Matlab

You must have Matlab on your system - Duke has a site licesne so you should be able to get it.

! pip install pymatbridge
! pip install matlab_kernel

Scala

Install Scala. Add these lines to ~/.bashrc

export SCALA_HOME=/usr/local/share/scala
export PATH=$PATH:$SCALA_HOME/bin:$PATH

Follow these instructions from the GitHub site:

Download and unpack pre-packaged binaries Scala 2.11. Unpack each downloaded archive(s), and, from a console, go to the bin sub-directory of the directory it contains. Then run the following to set-up the corresponding Scala kernel:

./jove-scala --kernel-spec

Installing extensions

See description of extensions here

And also see the tutorial on bibliographic support in Jupyter.

Spell-checking

! ipython install-nbextension \
    https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip

Notebook sections

! !ipython install-nbextension \
    https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip

Adding to configuration

%%file ~/.ipython/profile_default/static/custom/custom.js

require(["base/js/events"], function (events) {
    events.on("app_initialized.NotebookApp", function () {
        IPython.load_extensions('calico-spell-check', 'calico-document-tools');
        // To turn off automatically creating closing parenthesis and bracket:
        IPython.CodeCell.options_default.cm_config["autoCloseBrackets"] = "";
    });
});

Installing Python3 while keeping Python2

%%bash

conda create -n python3 python=3.4 anaconda
source activate python3
pip install -U ipython
ipython3 kernelspec install-self

Now, restart your notebook server

If you were successful, you should now see a large number of kernnel options in the New drop dwon menu.

Note that you can also change the kernel used for each individual cell!