Created
September 21, 2011 03:34
-
-
Save minrk/1231171 to your computer and use it in GitHub Desktop.
Script for user-only installs of Cython, PyZMQ, IPython, and tornado from git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment