IPython notebook makes for a very productive print-ready advanced REPL. When combined with Theano, and other python datascience tools, it’s almost unbeatable.

However, the installation instructions for each component are a little scattered, and this is an end-to-end explanation of what worked for me.

First steps (RPMs)

First, update the system so that the basics are there :

sudo yum update bash
sudo yum install python-virtualenv 

Install interop and numerical RPMs

For ‘pylearn2’ and ‘ipython notebook’ :

sudo yum install libyaml-devel zeromq-devel

For SciPy :

sudo yum install openblas-devel atlas-devel gcc-gfortran

For matplotlib:

sudo yum install libpng-devel freetype-devel

Later, I’ll be experimenting with OpenCL - and hope that Theano will be able to make use of CLBLAS, etc. (Fingers-crossed).

VirtualEnv setup

virtualenv env
. env/bin/activate

Python environment installation within the virtualenv, with bleeding-edge Theano and PyLearn2 :

pip install cython numpy

# This directory chosen as 'neutral'
cd env

  git clone git://github.com/Theano/Theano.git
  cd Theano
    # By setting up 'develop', this directory becomes live in-place
    python setup.py develop
  cd ..

  git clone git://github.com/lisa-lab/pylearn2.git
  cd pylearn2
    # By setting up 'develop', this directory becomes live in-place
    python setup.py develop
  cd ..

cd ..

IPython notebook installation

Python environment installation within the virtualenv (apparently ipython installation on its own doesn’t pull in the dependencies) :

pip install ipython pyzmq jinja2 tornado matplotlib

IPython notebook running

ipython notebook
# and open a browser to http://localhost:8888/

The ‘magic’ required to enable inline plotting by matplotlib with the IPython notebook is :

%matplotlib inline

Have fun!

Martin Andrews

{Finance, Software, AI} entrepreneur, living in Singapore with my family.

blog comments powered by Disqus