New Install
This document covers how to do the python-EGG install for GraphTool
One recent development in python software development is the egg format, which allows for a simple, straightforward installation process.
Note that SL3/RHEL3 is not supported.
Install process for SL4:
System dependencies
There is one additional system dependency beyond the standard SL4 deploy, libpng-devel. We also suggest installing subversion if the configurations you use are kept at Nebraska:
yum install libpng-devel subversion
This needs to be done as a root user.
If you are installing GraphTool on non-SL4 nodes (such as your Mac OS X laptop), you need to make sure png.h exists and decent compilers are installed. I have no problems installing GraphTool on Mac OS X if the Xcode tools were already there.
Prepare local area for GraphTool
We suggest that you do not install GraphTool as root. Instead, most people install it to their home directory. For this document, we'll install it into ~/eggs and assume that you are using bash shell. Csh users will need to adjust the instructions accordingly. First, create this directory and add it to your python path:
mkdir ~/eggs
export PYTHONPATH=$PYTHONPATH:~/eggs
export PATH=$PATH:~/eggs
Add the following lines to your ~/.bashrc:
export PYTHONPATH=$PYTHONPATH:~/eggs
export PATH=$PATH:~/eggs
Now, download the ez_setup script and run it:
curl -O http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py --install-dir=~/eggs
This will install the setuptools package, which will help the rest of the process along. Setuptools tries to automatically resolve and install dependencies for you, so you don't have to. It has problems with a few of our dependencies, so you'll need to install them beforehand:
easy_install --install-dir=~/eggs --find-links http://www.pythonware.com/products/pil Imaging
Now, download and install the GraphTool egg:
curl -O http://t2.unl.edu/downloads/graphtool-0.5.2-py2.3.egg
easy_install --install-dir=~/eggs graphtool-0.5.2-py2.3.egg
Note: currently, the install of matplotlib fails on the first attempt. Simply run the easy_install line twice; it installs correctly on the second go-around.
$ pythonIf there are no exceptions thrown, the install has succeeded.
Python 2.3.4 (#1, Oct 9 2006, 17:08:35)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylab import *
>>> import graphtool
>>>
A full install script
This section is for the lazy folks who don't feel like reading the explanation above and just want to copy/paste the below script and get GraphTool installed:
mkdir ~/eggsThat's right - the last line is repeated.
export PYTHONPATH=$PYTHONPATH:~/eggs
export PATH=$PATH:~/eggs
echo "export PYTHONPATH=$PYTHONPATH:~/eggs" >> ~/.bashrc
echo "export PATH=$PATH:~/eggs" >> ~/.bashrc
curl -O http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py --install-dir=~/eggs
easy_install --install-dir=~/eggs --find-links http://www.pythonware.com/products/pil Imaging
curl -O http://t2.unl.edu/downloads/graphtool-0.5.2-py2.3.egg
easy_install --install-dir=~/eggs graphtool-0.5.2-py2.3.egg
easy_install --install-dir=~/eggs graphtool-0.5.2-py2.3.egg
Optional dependencies
Once GraphTool is installed, you may want to install some of the additional dependencies if you will be using the database or web components. The eggs for the various databases are:MySQL:
easy_install --install-dir=~/eggs MySQL-python
Oracle:
easy_install --install-dir=~/eggs cx_Oracle
Postgres:
Required RPMs (on RHEL) for install: postgresql-libs, postgresql-devel.
These must be installed prior to the egg. There was a report of
Postgres-related errors for Postgres 8.1, which were solved by
upgrading to Postgres 8.2.x. I have not been able to reproduce this,
but might be a good place to start if you have problems.
easy_install --install-dir=~/eggs PyGreSQL
SQLite:
Python 2.5 has SQLite libraries built-in to the standard library. If you have python 2.5, there is no action to take. Otherwise:
easy_install --install-dir=~/eggs pysqliteYou will need to have the client and development libraries for each of the above databases installed prior to downloading the bindings.