<divid="unreleased-message"> You are reading an old version of the documentation (v1.5.3). For the latest version see <ahref="https://matplotlib.org/stable/users/installing.html">https://matplotlib.org/stable/users/installing.html</a></div>
<h3>Most platforms : scientific Python distributions<aclass="headerlink" href="#most-platforms-scientific-python-distributions" title="Permalink to this headline">¶</a></h3>
<p>The first option is to use one of the pre-packaged python
distributions that already provide matplotlib built-in. The
Continuum.io Python distribution (<aclass="reference external" href="https://www.continuum.io/downloads/">Anaconda</a> or <aclass="reference external" href="http://conda.pydata.org/miniconda.html">miniconda</a>) and the Enthought
distribution <aclass="reference external" href="https://www.enthought.com/products/canopy/">(Canopy)</a>
are both excellent choices that “just work” out of the box for
Windows, OSX and common Linux platforms. Both of these distributions
include matplotlib and <em>lots</em> of other useful tools.</p>
<h3>Mac OSX : using pip<aclass="headerlink" href="#mac-osx-using-pip" title="Permalink to this headline">¶</a></h3>
<p>If you are on Mac OSX you can probably install matplotlib binaries using the
standard Python installation program <aclass="reference external" href="https://pypi.python.org/pypi/pip/">pip</a>.
See <aclass="reference internal" href="../faq/installing_faq.html#install-osx-binaries"><spanclass="std std-ref">Installing OSX binary wheels</span></a>.</p>
</div>
<divclass="section" id="windows">
<spanid="installing-windows"></span><h3>Windows<aclass="headerlink" href="#windows" title="Permalink to this headline">¶</a></h3>
<p>If you don’t already have Python installed, we recommend using
one of the <aclass="reference external" href="http://www.scipy.org/install.html">scipy-stack compatible Python distributions</a> such as WinPython, Python(x,y),
Enthought Canopy, or Continuum Anaconda, which have matplotlib and many
of its dependencies, plus other useful packages, preinstalled.</p>
<p>TkAgg is probably the best backend for interactive use from the
standard Python shell or IPython. It is enabled as the default backend
for the official binaries. GTK3 is not supported on Windows.</p>
<p>The Windows wheels (<codeclass="file docutils literal"><spanclass="pre">*.whl</span></code>) on the <aclass="reference external" href="https://pypi.python.org/pypi/matplotlib/">PyPI download page</a> do not contain test data
or example code.
If you want to try the many demos that come in the matplotlib source
distribution, download the <codeclass="file docutils literal"><spanclass="pre">*.tar.gz</span></code> file and look in the
ffmpeg, avconv, mencoder, ImageMagick, and <aclass="reference external" href="https://inkscape.org/">Inkscape</a>.</p>
</div>
</div>
<divclass="section" id="installing-from-source">
<spanid="install-from-source"></span><h2>Installing from source<aclass="headerlink" href="#installing-from-source" title="Permalink to this headline">¶</a></h2>
<p>If you are interested in contributing to matplotlib development,
running the latest source code, or just like to build everything
yourself, it is not difficult to build matplotlib from source. Grab
the latest <em>tar.gz</em> release file from <aclass="reference external" href="https://pypi.python.org/pypi/matplotlib/">the PyPI files page</a>, or if you want to
develop matplotlib or just need the latest bugfixed version, grab the
latest git version <aclass="reference internal" href="../faq/installing_faq.html#install-from-git"><spanclass="std std-ref">Source install from git</span></a>.</p>
<p>We provide a <aclass="reference external" href="https://github.com/matplotlib/matplotlib/raw/master/setup.cfg.template">setup.cfg</a>
file that goes with <codeclass="file docutils literal"><spanclass="pre">setup.py</span></code> which you can use to customize
the build process. For example, which default backend to use, whether
some of the optional libraries that matplotlib ships with are
installed, and so on. This file will be particularly useful to those
packaging matplotlib.</p>
<p>If you have installed prerequisites to nonstandard places and need to
inform matplotlib where they are, edit <codeclass="docutils literal"><spanclass="pre">setupext.py</span></code> and add the base
dirs to the <codeclass="docutils literal"><spanclass="pre">basedir</span></code> dictionary entry for your <codeclass="docutils literal"><spanclass="pre">sys.platform</span></code>.
e.g., if the header to some required library is in
<codeclass="docutils literal"><spanclass="pre">/some/path/include/someheader.h</span></code>, put <codeclass="docutils literal"><spanclass="pre">/some/path</span></code> in the
<codeclass="docutils literal"><spanclass="pre">basedir</span></code> list for your platform.</p>
<divclass="section" id="build-requirements">
<spanid="install-requirements"></span><h3>Build requirements<aclass="headerlink" href="#build-requirements" title="Permalink to this headline">¶</a></h3>
<p>These are external packages which you will need to install before
installing matplotlib. If you are building on OSX, see
<aclass="reference internal" href="#build-osx"><spanclass="std std-ref">Building on OSX</span></a>. If you are building on Windows, see
<aclass="reference internal" href="#build-windows"><spanclass="std std-ref">Building on Windows</span></a>. If you are installing dependencies with a
package manager on Linux, you may need to install the development
packages (look for a “-dev” postfix) in addition to the libraries
themselves.</p>
<divclass="section" id="required-dependencies">
<h4>Required Dependencies<aclass="headerlink" href="#required-dependencies" title="Permalink to this headline">¶</a></h4>
<dlclass="docutils">
<dt><aclass="reference internal" href="../glossary/index.html#term-python"><spanclass="xref std std-term">python</span></a> 2.7, 3.4, or 3.5</dt>
<dd>Used to manipulate time-zone aware datetimes. <aclass="reference external" href="http://pypi.python.org/pypi/pytz">http://pypi.python.org/pypi/pytz</a></dd>
<dt><aclass="reference internal" href="../glossary/index.html#term-freetype"><spanclass="xref std std-term">freetype</span></a> 2.3 or later</dt>
<dd>library for reading true type font files.</dd>
<dt><aclass="reference external" href="http://matplotlib.org/cycler/">cycler</a> 0.9 or later</dt>
<dd>Composable cycle class used for constructing style-cycles</dd>
</dl>
</div>
<divclass="section" id="optional-gui-framework">
<h4>Optional GUI framework<aclass="headerlink" href="#optional-gui-framework" title="Permalink to this headline">¶</a></h4>
<p>These are optional packages which you may want to install to use
matplotlib with a user interface toolkit. See
<aclass="reference internal" href="../faq/usage_faq.html#what-is-a-backend"><spanclass="std std-ref">What is a backend?</span></a> for more details on the optional matplotlib
backends and the capabilities they provide.</p>
<dlclass="docutils">
<dt><aclass="reference internal" href="../glossary/index.html#term-tk"><spanclass="xref std std-term">tk</span></a> 8.3 or later, not 8.6.0 or 8.6.1</dt>
<dd><pclass="first">The TCL/Tk widgets library used by the TkAgg backend.</p>
<pclass="last">Versions 8.6.0 and 8.6.1 are known to have issues that may result
in segfaults when closing multiple windows in the wrong order.</p>
</dd>
<dt><aclass="reference internal" href="../glossary/index.html#term-pyqt"><spanclass="xref std std-term">pyqt</span></a> 4.0 or later</dt>
<dd>The Qt4 widgets library python wrappers for the Qt4Agg backend</dd>
<dt><aclass="reference internal" href="../glossary/index.html#term-pygtk"><spanclass="xref std std-term">pygtk</span></a> 2.4 or later</dt>
<dd>The python wrappers for the GTK widgets library for use with the
GTK or GTKAgg backend</dd>
<dt><aclass="reference internal" href="../glossary/index.html#term-wxpython"><spanclass="xref std std-term">wxpython</span></a> 2.8 or later</dt>
<dd>The python wrappers for the wx widgets library for use with the
<h4>Required libraries that ship with matplotlib<aclass="headerlink" href="#required-libraries-that-ship-with-matplotlib" title="Permalink to this headline">¶</a></h4>