User Tools

Site Tools


cmpy:home

'#' signifies a comment. Don't type it or anything after it.

CMPy requires a very recent version of NetworkX:

$ svn co http://networkx.lanl.gov/svn/networkx/trunk networkx
$ cd networkx
$ python setup.py install --user        # python 2.6, ~/.local/lib/python2.6/site-packages/networkx
$ python setup.py install --prefix=~/   # python 2.5, ~/lib/python2.5/site-packages/networkx

If you don't want to install from SVN, you can download the nightly tarball here:

http://networkx.lanl.gov/download/networkx/

Grab the most recent .tar.gz file. Then install as usual. For example,

$ wget http://networkx.lanl.gov/download/networkx/networkx-1.1.dev1527.tar.gz
$ tar -zxvf networkx-1.1.dev1527.tar.gz
$ cd networkx-1.1.dev1527
$ python setup.py install --user        # python 2.6, ~/.local/lib/python2.6/site-packages/networkx
$ python setup.py install --prefix=~/   # python 2.5, ~/lib/python2.5/site-packages/networkx

PyGraphviz is a useful, optional dependency.

$ svn co http://networkx.lanl.gov/svn/pygraphviz/trunk pygraphviz
$ cd pygraphviz
$ python setup.py install --user        # python 2.6, ~/.local/lib/python2.6/site-packages/pygraphviz
$ python setup.py install --prefix=~/   # python 2.5, ~/lib/python2.5/site-packages/pygraphviz

If you are having an issue installing pygraphviz see this.

There are two ways to obtain CMPy. If you have read-only access, use:


Do *NOT* try this, CMPY read only is disabled. Let me know if you want that changed. – Bill


$ git clone git://vcs.cse.ucdavis.edu/cmpy.git

If you have read-write access, your SSH public key will be used with the following:

$ git clone git@vcs.cse.ucdavis.edu:cmpy.git

In either situation, you can install CMPy via:

$ cd cmpy
$ python setup.py install --user        # python 2.6, ~/.local/lib/python2.6/site-packages/cmpy
$ python setup.py install --prefix=~/   # python 2.5, ~/lib/python2.5/site-packages/cmpy

Try to import:

$ cd
$ python -c "import cmpy"

You might need to set your PYTHONPATH. For example, if your shell is csh:

$ setenv PYTHONPATH ~/lib/python2.5/site-packages

If your shell is bash:

export PYTHONPATH=~/lib/python2.5/site-packages

To make this permanent, add the above line to your shell's configuration file. For csh, it is '.cshrc'. For bash, it is '.bashrc'. Google it.

To update CMPy:

$ cd cmpy
$ git pull
$ python setup.py install --user        # python 2.6, ~/.local/lib/python2.6/site-packages/cmpy
$ python setup.py install --prefix=~/   # python 2.5, ~/lib/python2.5/site-packages/cmpy

Trouble updating? Perhaps you are having trouble updating CMPy, and during a 'git pull', you receive something like the following:

$ cd cmpy
$ git pull
fatal: Unable to look up vcs.cse.ucdavis.edu (port 9418) (nodename nor servname provided, or not known)

If you are on the Math wireless access point, try switching to CSE access point.

To update NetworkX:

$ # do this only if CMPy complains that your NetworkX is not new enough
$ cd networkx/trunk
$ svn update
$ python setup.py install --user        # python 2.6, ~/.local/lib/python2.6/site-packages/cmpy
$ python setup.py install --prefix=~/   # python 2.5, ~/lib/python2.5/site-packages/cmpy

To commit changes to the global repo:

$ # do your local edits and your local commits
$ # when you are ready to push upstream...(you must have proper access)
$ git pull
$ git push

To view a web page on recent commits, visit: https://vcs.cse.ucdavis.edu/git/cmpy.git

cmpy/home.txt · Last modified: 2010/10/22 22:22 by bill