Installing ipython notebook to replace matlab

Here is a recipe for installing the amazing ipython notebook. This is for Ubuntu 10.04 Lucid:

virtualenv ~/pyenvs/notebook
source ~/pyenvs/notebook/bin/activate
 
#install zeromq using these hints: http://johanharjono.com/archives/633
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/zeromq
sudo add-apt-repository ppa:chris-lea/libpgm
sudo apt-get update
sudo apt-get install libzmq1
sudo apt-get install libzmq-dev
sudo apt-get install libpgm-5.1-0
pip install pyzmq
 
pip install tornado
pip install --upgrade ipython
pip install numpy
pip install matplotlib

Now, we want to create a profile for running a notebook server on a public port. Use this command:

ipython profile create nbserver

This will create a directory named ~/.ipython/profile_nbserver with a bunch of files in it. Since we are running public mode, we need a hashed password. Generate one like so:

In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'

Now edit the file named ~/.ipython/profile_nbserver/ipython_notebook_config.py. This file will already be populated by a lot of configuration, most of which is commented out. You will want to uncomment/edit these lines:

c = get_config()
 
# When disabled, equations etc. will appear as their untransformed TeX source.                             
c.NotebookApp.enable_mathjax = True
 
# The string should be of the form type:salt:hashed-password.                                              
c.NotebookApp.password = u'sha1:xxx:yyyyy' #from above
 
# The IP address the notebook server will listen on.                                                       
c.NotebookApp.ip = '*'
 
# Pre-load matplotlib and numpy for interactive use, selecting a particular                                
# matplotlib backend and loop integration.                                                                 
c.IPKernelApp.pylab = 'inline'

Also, you might want these:

c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem'
c.NotebookApp.open_browser = False

Now, start your server like so:

ipython notebook --profile=nbserver

Connect to your server with firefox, and you should be good to go!