public
Last active

Script for user-only installs of Cython, PyZMQ, IPython, and tornado from git

  • Download Gist
ipdev.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
#!/bin/bash
 
prefix="$HOME/.local"
 
# 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
# export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_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
 
info(){
echo "******************************"
echo "$1"
echo "******************************"
}
 
# run as ./thisscript foo to get the code into 'foo' instead of 'code'
if [ ! -z "$1" ]; then
d="$1"
else
d="code"
fi
 
test -d $d || mkdir $d
cd $d
 
working=`pwd`
 
info "working in $working"
zeromq="zeromq-2.1.9"
info "fetching $zeromq "
wget -nc http://download.zeromq.org/$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://github.com/cython/cython.git
cd cython && git pull
info "building cython (requires python-dev)"
python setup.py build
info "installing cython"
python setup.py install --user
 
cd "$working"
info "fetching pyzmq"
test -d pyzmq || git clone git://github.com/zeromq/pyzmq.git
cd pyzmq && git pull
info "building pyzmq"
python setup.py configure --zmq="$prefix"
info "building pyzmq"
python setup.py build
info "installing pyzmq"
python setup.py install --user
 
cd "$working"
info "fetching IPython"
test -d ipython || git clone git://github.com/ipython/ipython.git
cd ipython && git pull
info "installing IPython"
python setup.py install --user
 
cd "$working"
info "fetching Tornado for the notebook server"
test -d tornado || git clone git://github.com/facebook/tornado.git
cd tornado && git pull
info "installing Tornado"
python setup.py 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!"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.