Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Script for user-only installs of Cython, PyZMQ, IPython, and tornado from git
# This script will install everything you need to use current git versions of Cython, PyZMQ, and IPython
# for this user.
# We assume you have things set up for a typical python `--user` environment
# which installs user-only things in ~/.local. e.g. adding the following lines
# to your bashrc or profile:
# export PATH=$HOME/.local/bin:$PATH
# There is no need to set PYTHONPATH with this prefix, but if you use something
# else, you may also need to add $prefix/lib/pythonX.Y/site-packages to PYTHONPATH
# building libzmq depends on uuid-dev
# and you will need pyqt and pygments for the qtconsole, and python-dev for cython (and everything)
# and git to fetch the sources:
# this will get all the dependencies you need:
# sudo apt-get install uuid-dev python-dev python-qt4 python-pygments git
# stop on fail:
set -e
echo "******************************"
echo "$1"
echo "******************************"
# run as ./thisscript foo to get the code into 'foo' instead of 'code'
if [ ! -z "$1" ]; then
test -d $d || mkdir $d
cd $d
info "working in $working"
info "fetching $zeromq "
wget -nc$zeromq.tar.gz
tar -xzf $zeromq.tar.gz
info "configuring zeromq (requires uuid-dev)"
cd $zeromq
./configure --prefix="$prefix"
cd src
make && make install
cd "$working"
info "fetching cython"
test -d cython || git clone git://
cd cython && git pull
info "building cython (requires python-dev)"
python build
info "installing cython"
python install --user
cd "$working"
info "fetching pyzmq"
test -d pyzmq || git clone git://
cd pyzmq && git pull
info "building pyzmq"
python configure --zmq="$prefix"
info "building pyzmq"
python build
info "installing pyzmq"
python install --user
cd "$working"
info "fetching IPython"
test -d ipython || git clone git://
cd ipython && git pull
info "installing IPython"
python install --user
cd "$working"
info "fetching Tornado for the notebook server"
test -d tornado || git clone git://
cd tornado && git pull
info "installing Tornado"
python install --user
## dependencies for qtconsole:
info "The QtConsole requires PyQt4 and Pygments, which can be installed with
$> sudo apt-get install python-qt4 python-pygments
pygments can also be easy_installed
info "Success!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment