Table Of Contents

Previous topic


Next topic



Quick install

Get NetworkX from the Python Package Index at

or install it with:

easy_install networkx

and an attempt will be made to find and install an appropriate version that matches your operating system and Python version.

More download options are at

Installing from source

You can install from source by downloading a source archive file (tar.gz or zip) or by checking out the source files from the Subversion repository.

NetworkX is a pure Python package; you don’t need a compiler to build or install it.

Source archive file

  1. Download the source (tar.gz or zip file).
  2. Unpack and change directory to networkx-“version”
  3. Run “python install” to build and install
  4. (optional) Run “python nosetests” to execute the tests

SVN repository

  1. Check out the networkx trunk:

    svn co networkx
  2. Change directory to “networkx”

  3. Run “python install” to build and install

  4. (optional) Run “python nosetests” to execute the tests

If you don’t have permission to install software on your system, you can install into another directory using the –prefix or –home flags to

For example

python install --prefix=/home/username/python
python install --home=~

If you didn’t install in the standard Python site-packages directory you will need to set your PYTHONPATH variable to the alternate location. See for further details.

Installing pre-built packages


Download and run the latest version of the Windows installer (.exe extension).

OSX 10.5

Download and install the latest mpkg.


Debian packages are available at



To use NetworkX you need Python version 2.4, 2.5, or 2.6

The easiest way to get Python and most optional packages is to install the Enthought Python distribution

Other options are



OSX 10.5 ships with Python version 2.5. If you have an older version we encourage you to download a newer release. Pre-built Python packages are available from

If you are using Fink or MacPorts, Python is available through both of those package systems.


Python is included in all major Linux distributions

Optional packages

NetworkX will work without the following optional packages but they may be added for additional functionality.



Provides sparse matrix representation of graphs and many numerical scientific tools.


Provides flexible drawing of graphs


In conjunction with either


provides graph drawing and graph layout algorithms.


Required for pydot, GML file reading.


Required for YAML format reading and writing.

Other packages

These are extra packages you may consider using with NetworkX