Installing pyxnat

Platforms

OS Independent.

It was tested under:
  • Ubuntu 9.04 with python 2.6
  • Ubuntu 8.04 with python 2.5
  • Mandriva 2008 with python 2.5
  • Windows XP with python 2.6

Prerequisites

  • java v1.6+:

    At the moment the REST client used is the one shipped with the xnat tools (http://nrg.wustl.edu/1.4/xnat_tools.zip)

  • python v2.5+

  • python-lxml v1.3.6+ recommanded, earlier versions may work:

    All Python dependencies but lxml are shipped with this package. Lxml may be installed using standard Python distribution tools, here are the recommanded ones. For more details on installing procedures please see the sections following this one.

    1. easy_install: lxml may be installed via easy_install under Unix and Windows
    2. Windows only: a .exe installer is provided

The easy_install way

The easiest way to install pyxnat is (provided that you have setuptools installed) to run:

easy_install pyxnat

You may need to run the above command as administrator

On a unix environment, it is better to install outside of the hierarchy managed by the system:

easy_install –prefix /usr/local pyxnat

Warning

Packages installed via easy_install override the Python module look up mechanism and thus can confused people not familiar with setuptools. Although it may seem harder, we suggest that you use the manual way, as described in the following paragraph.

The manual way

To install pyxnat first download the latest tarball (follow the link on the bottom of http://pypi.python.org/pypi/pyxnat) and expand it.

Installing in a local environment

If you don’t need to install for all users, we strongly suggest that you create a local environment and install pyxnat in it. One of the pros of this method is that you never have to become administrator, and thus all the changes are local to your account and easy to clean up.

  1. First, create the following directory (where ~ is your home directory, or any directory that you want to use as a base for your local Python environment, and X is your Python version number, e.g. 2.6):

    ~/usr/lib/pythonX/site-packages
  2. Second, make sure that you add this directory in your environment variable PYTHONPATH. Under window you can do this by editing your environment variables in the system parameters dialog. Under Unix you can add the following line to your .bashrc or any file source at login:

    export PYTHONPATH=$HOME/usr/lib/python2.6/site-packages:$PYTHONPATH
  3. In the directory created by expanding the pyxnat tarball, run the following command:

    python setup.py install --prefix ~/usr

    You should not be required to become administrator, if you have write access to the directory you are installing to.

Installing for all users

If you have administrator rights and want to install for all users, all you need to do is to go in directory created by expanding the pyxnat tarball and run the following line:

python setup.py install

If you are under Unix, we suggest that you install in ‘/usr/local’ in order not to interfere with your system:

python setup.py install --prefix /usr/local