<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Installing — NetworkX 1.8.1 documentation</title> <link rel="stylesheet" href="_static/networkx.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '', VERSION: '1.8.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: false }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within NetworkX 1.8.1 documentation" href="_static/opensearch.xml"/> <link rel="top" title="NetworkX 1.8.1 documentation" href="index.html" /> <link rel="next" title="Tutorial" href="tutorial/index.html" /> <link rel="prev" title="Download" href="download.html" /> </head> <body> <div style="color: black;background-color: white; font-size: 3.2em; text-align: left; padding: 15px 10px 10px 15px"> NetworkX </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="tutorial/index.html" title="Tutorial" accesskey="N">next</a> |</li> <li class="right" > <a href="download.html" title="Download" accesskey="P">previous</a> |</li> <li><a href="http://networkx.github.com/">NetworkX Home </a> | </li> <li><a href="http://networkx.github.com/documentation.html">Documentation </a>| </li> <li><a href="http://networkx.github.com/download.html">Download </a> | </li> <li><a href="http://github.com/networkx">Developer (Github)</a></li> </ul> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Installing</a><ul> <li><a class="reference internal" href="#quick-install">Quick install</a></li> <li><a class="reference internal" href="#installing-from-source">Installing from source</a><ul> <li><a class="reference internal" href="#source-archive-file">Source archive file</a></li> <li><a class="reference internal" href="#github">Github</a></li> </ul> </li> <li><a class="reference internal" href="#requirements">Requirements</a><ul> <li><a class="reference internal" href="#python">Python</a></li> </ul> </li> <li><a class="reference internal" href="#optional-packages">Optional packages</a><ul> <li><a class="reference internal" href="#numpy">NumPy</a></li> <li><a class="reference internal" href="#scipy">SciPy</a></li> <li><a class="reference internal" href="#matplotlib">Matplotlib</a></li> <li><a class="reference internal" href="#graphviz">GraphViz</a></li> <li><a class="reference internal" href="#pyparsing">Pyparsing</a></li> <li><a class="reference internal" href="#pyyaml">PyYAML</a></li> <li><a class="reference internal" href="#other-packages">Other packages</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="download.html" title="previous chapter">Download</a></p> <h4>Next topic</h4> <p class="topless"><a href="tutorial/index.html" title="next chapter">Tutorial</a></p> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="installing"> <h1>Installing<a class="headerlink" href="#installing" title="Permalink to this headline">¶</a></h1> <div class="section" id="quick-install"> <h2>Quick install<a class="headerlink" href="#quick-install" title="Permalink to this headline">¶</a></h2> <p>Get NetworkX from the Python Package Index at <a class="reference external" href="http://pypi.python.org/pypi/networkx">http://pypi.python.org/pypi/networkx</a></p> <p>or install it with:</p> <div class="highlight-python"><pre>pip install networkx</pre> </div> <p>and an attempt will be made to find and install an appropriate version that matches your operating system and Python version.</p> <p>You can install the development version (at github.com) with:</p> <div class="highlight-python"><pre>pip install git://github.com/networkx/networkx.git#egg=networkx</pre> </div> <p>More download file options are at <a class="reference external" href="http://networkx.github.io/download.html">http://networkx.github.io/download.html</a></p> </div> <div class="section" id="installing-from-source"> <h2>Installing from source<a class="headerlink" href="#installing-from-source" title="Permalink to this headline">¶</a></h2> <p>You can install from source by downloading a source archive file (tar.gz or zip) or by checking out the source files from the Mercurial source code repository.</p> <p>NetworkX is a pure Python package; you don’t need a compiler to build or install it.</p> <div class="section" id="source-archive-file"> <h3>Source archive file<a class="headerlink" href="#source-archive-file" title="Permalink to this headline">¶</a></h3> <blockquote> <div><ol class="arabic simple"> <li>Download the source (tar.gz or zip file) from <a class="reference external" href="https://pypi.python.org/pypi/networkx/">https://pypi.python.org/pypi/networkx/</a> or get the latest development version from <a class="reference external" href="https://github.com/networkx/networkx/">https://github.com/networkx/networkx/</a></li> <li>Unpack and change directory to the source directory (it should have the files README.txt and setup.py).</li> <li>Run “python setup.py install” to build and install</li> <li>(optional) Run “python setup_egg.py nosetests” to execute the tests</li> </ol> </div></blockquote> </div> <div class="section" id="github"> <h3>Github<a class="headerlink" href="#github" title="Permalink to this headline">¶</a></h3> <blockquote> <div><ol class="arabic"> <li><p class="first">Clone the networkx repostitory</p> <blockquote> <div><p>git clone <a class="reference external" href="https://github.com/networkx/networkx.git">https://github.com/networkx/networkx.git</a></p> </div></blockquote> </li> </ol> <p>(see <a class="reference external" href="https://github.com/networkx/networkx/">https://github.com/networkx/networkx/</a> for other options)</p> <ol class="arabic simple" start="2"> <li>Change directory to “networkx”</li> <li>Run “python setup.py install” to build and install</li> <li>(optional) Run “python setup_egg.py nosetests” to execute the tests</li> </ol> </div></blockquote> <p>If you don’t have permission to install software on your system, you can install into another directory using the –user, –prefix, or –home flags to setup.py.</p> <p>For example</p> <div class="highlight-python"><pre>python setup.py install --prefix=/home/username/python or python setup.py install --home=~ or python setup.py install --user</pre> </div> <p>If you didn’t install in the standard Python site-packages directory you will need to set your PYTHONPATH variable to the alternate location. Seehttp://docs.python.org/2/install/index.html#search-path for further details.</p> </div> </div> <div class="section" id="requirements"> <h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h2> <div class="section" id="python"> <h3>Python<a class="headerlink" href="#python" title="Permalink to this headline">¶</a></h3> <p>To use NetworkX you need Python version 2.6 or later. Most of NetworkX works with Python version 3.1.2 or later. <a class="reference external" href="http://www.python.org/">http://www.python.org/</a></p> <p>The easiest way to get Python and most optional packages is to install the Enthought Python distribution “Canopy” <a class="reference external" href="https://www.enthought.com/products/canopy/">https://www.enthought.com/products/canopy/</a></p> <p>There are several other distributions that contain the key packages you need for scientific computing. See the following link for a list: <a class="reference external" href="http://scipy.org/install.html">http://scipy.org/install.html</a></p> </div> </div> <div class="section" id="optional-packages"> <h2>Optional packages<a class="headerlink" href="#optional-packages" title="Permalink to this headline">¶</a></h2> <p>The following are optional packages that NetworkX can use to provide additional functions.</p> <div class="section" id="numpy"> <h3>NumPy<a class="headerlink" href="#numpy" title="Permalink to this headline">¶</a></h3> <p>Provides matrix representation of graphs and is used in some graph algorithms for high-performance matrix computations.</p> <blockquote> <div><ul class="simple"> <li>Download: <a class="reference external" href="http://scipy.org/Download">http://scipy.org/Download</a></li> </ul> </div></blockquote> </div> <div class="section" id="scipy"> <h3>SciPy<a class="headerlink" href="#scipy" title="Permalink to this headline">¶</a></h3> <p>Provides sparse matrix representation of graphs and many numerical scientific tools.</p> <blockquote> <div><ul class="simple"> <li>Download: <a class="reference external" href="http://scipy.org/Download">http://scipy.org/Download</a></li> </ul> </div></blockquote> </div> <div class="section" id="matplotlib"> <h3>Matplotlib<a class="headerlink" href="#matplotlib" title="Permalink to this headline">¶</a></h3> <p>Provides flexible drawing of graphs.</p> <blockquote> <div><ul class="simple"> <li>Download: <a class="reference external" href="http://matplotlib.sourceforge.net/">http://matplotlib.sourceforge.net/</a></li> </ul> </div></blockquote> </div> <div class="section" id="graphviz"> <h3>GraphViz<a class="headerlink" href="#graphviz" title="Permalink to this headline">¶</a></h3> <p>In conjunction with either</p> <blockquote> <div><ul class="simple"> <li>PyGraphviz: <a class="reference external" href="http://networkx.lanl.gov/pygraphviz/">http://networkx.lanl.gov/pygraphviz/</a></li> </ul> <p>or</p> <ul class="simple"> <li>pydot: <a class="reference external" href="http://code.google.com/p/pydot/">http://code.google.com/p/pydot/</a></li> </ul> </div></blockquote> <p>provides graph drawing and graph layout algorithms.</p> <blockquote> <div><ul class="simple"> <li>Download: <a class="reference external" href="http://graphviz.org/">http://graphviz.org/</a></li> </ul> </div></blockquote> </div> <div class="section" id="pyparsing"> <h3>Pyparsing<a class="headerlink" href="#pyparsing" title="Permalink to this headline">¶</a></h3> <p><a class="reference external" href="http://pyparsing.wikispaces.com/">http://pyparsing.wikispaces.com/</a></p> <p>Required for pydot, GML file reading.</p> </div> <div class="section" id="pyyaml"> <h3>PyYAML<a class="headerlink" href="#pyyaml" title="Permalink to this headline">¶</a></h3> <p><a class="reference external" href="http://pyyaml.org/">http://pyyaml.org/</a></p> <p>Required for YAML format reading and writing.</p> </div> <div class="section" id="other-packages"> <h3>Other packages<a class="headerlink" href="#other-packages" title="Permalink to this headline">¶</a></h3> <p>These are extra packages you may consider using with NetworkX</p> <blockquote> <div><ul class="simple"> <li>IPython, interactive Python shell, <a class="reference external" href="http://ipython.scipy.org/">http://ipython.scipy.org/</a></li> </ul> </div></blockquote> </div> </div> </div> </div> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="tutorial/index.html" title="Tutorial" >next</a> |</li> <li class="right" > <a href="download.html" title="Download" >previous</a> |</li> <li><a href="http://networkx.github.com/">NetworkX Home </a> | </li> <li><a href="http://networkx.github.com/documentation.html">Documentation </a>| </li> <li><a href="http://networkx.github.com/download.html">Download </a> | </li> <li><a href="http://github.com/networkx">Developer (Github)</a></li> </ul> </div> <div class="footer"> © Copyright 2013, NetworkX Developers. Last updated on Oct 23, 2013. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>