Installing pyxnat


OS Independent.

It was tested under:
  • Ubuntu 10.04 with python 2.6
  • Ubuntu 11.04 with python 2.7
  • Debian Squeeze with python 2.6
  • Windows XP with python 2.7
  • Mac OS X untested but should work with python >= 2.6


  • python v2.6+

  • python-lxml v1.3.6+ recommanded, earlier versions may work: 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: installers are provided here, select the .exe for your python version and install.

    3. Most linux distributions provide a package for lxml. e.g. for debian or debian-based distributions:

      apt-get install python-lxml
    4. Mac OS X: a macport of lxml is available, see lxml site for further information.

      Alternatively, you can compile the package from sources by following the instructions. If the recommanded command on the site fails:

      python build --static-deps

      Try forcing an older version of libxml2:

      python build --static-deps --libxml2-version=2.7.3

      Do not forget to add lxml to your PYTHONPATH afterwards.

  • python-httplib2 v0.6+, a version above 0.7 is however recommanded:

    1. On all platforms:

      easy_install httplib2
    2. Or with the packaging system on linux e.g. for debian:

      apt-get install python-httplib2
  • SocksiPy-branch not required, v1.02 recommended, earlier versions may work: This library is required only if you want to run pyxnat through a proxy. The original SocksiPy dependency for httplib2 is abandoned and unavailable on PyPi, but seems to work. SocksiPy-branch is available on PyPi.

  • python-nose v0.10+ to run the unit tests

  • networkx and matplotlib are not mandatory:

    These libraries are used to make some graphical representations.

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


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 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):

  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 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 install

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

python install --prefix /usr/local


Go in the directory ‘pyxnat/tests’ and run the nosetests command.

Table Of Contents

This Page