Tuesday, 14 February 2012

Building ipython from source

Late last year I saw a demonstration of one of the newest versions of ipython at the Melbourne Python Users Group. It was perhaps one of the most astonishing pieces of open source software I've seen, with a new web-based notebook interface that is very similar to what you would expect in a commercial package like MATLAB or Mathematica.

At the moment the newest versions of ipython aren't in the Debian/Ubuntu repositories (at least for the versions of Ubuntu I care about). What follows is a makefile that documents the steps that I've gone through to get the newest version installed on a close to clean installation of Oneiric (11.10).

It's worth noting that this process is still somewhat manual because the versions of some of the dependent packages are changing so quickly, and it is likely that some manual intervention will be required.

ZEROMQ=zeromq-2.1.11
SIP=sip-4.13.2
PYQT4=PyQt-x11-gpl-4.9.1
TORNADO=tornado-2.2

install:
    sudo apt-get install python-scipy \
        python-matplotlib \
        mayavi2 \
        git-core \
        build-essential \
        python-setuptools \
        python-dev 
    sudo easy_install nose \
        pexpect \
        pygments

zeromq:
    sudo apt-get install uuid-dev \
        libtool \
        autoconf 
    wget -c http://download.zeromq.org/${ZEROMQ}.tar.gz
    tar zxvf ${ZEROMQ}.tar.gz
    cd ${ZEROMQ} && ./configure
    cd ${ZEROMQ} && make 
    cd ${ZEROMQ} && sudo make install
    sudo ldconfig
    sudo easy_install pyzmq

sip:
    wget -c http://www.riverbankcomputing.co.uk/static/Downloads/sip4/${SIP}.tar
    tar zxvf ${SIP}.tar.gz
    cd ${SIP} && python configure.py
    cd ${SIP} && make
    cd ${SIP} && sudo make install

qt4:
    sudo apt-get install libqt4-dev
    wget -c http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/${PYQT4}.
    tar zxvf ${PYQT4}.tar.gz
    cd ${PYQT4} && python configure.py
    cd ${PYQT4} && make
    cd ${PYQT4} && sudo make install

tornado:
    wget -c https://github.com/downloads/facebook/tornado/${TORNADO}.tar.gz
    tar zxvf ${TORNADO}.tar.gz
    cd ${TORNADO} && sudo python setup.py install
    
ipython: 
    git clone https://github.com/ipython/ipython.git
    cd ipython && sudo python setup.py install

No comments:

Post a Comment