<spanid="id1"></span><h1>Dependencies<aclass="headerlink" href="#dependencies" title="Permalink to this headline">#</a></h1>
<sectionid="runtime-dependencies">
<h2>Runtime dependencies<aclass="headerlink" href="#runtime-dependencies" title="Permalink to this headline">#</a></h2>
<sectionid="mandatory-dependencies">
<h3>Mandatory dependencies<aclass="headerlink" href="#mandatory-dependencies" title="Permalink to this headline">#</a></h3>
<p>When installing through a package manager like <codeclass="docutils literal notranslate"><spanclass="pre">pip</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">conda</span></code>, the
mandatory dependencies are automatically installed. This list is mainly for
<spanid="id2"></span><h3>Optional dependencies<aclass="headerlink" href="#optional-dependencies" title="Permalink to this headline">#</a></h3>
<p>The following packages and tools are not required but extend the capabilities
of Matplotlib.</p>
<sectionid="backends">
<h4>Backends<aclass="headerlink" href="#backends" title="Permalink to this headline">#</a></h4>
<p>Matplotlib figures can be rendered to various user interfaces. See
<aclass="reference internal" href="../users/explain/backends.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>
<ulclass="simple">
<li><p><aclass="reference external" href="https://docs.python.org/3/library/tk.html">Tk</a> (>= 8.4, != 8.6.0 or 8.6.1) <aclass="footnote-reference brackets" href="#id6" id="id3">1</a>: for the Tk-based backends.</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/PyQt6/">PyQt6</a> (>= 6.1), <aclass="reference external" href="https://pypi.org/project/PySide6/">PySide6</a>, <aclass="reference external" href="https://pypi.org/project/PyQt5/">PyQt5</a>, or <aclass="reference external" href="https://pypi.org/project/PySide2/">PySide2</a>: for the Qt-based backends.</p></li>
<li><p><aclass="reference external" href="https://pygobject.readthedocs.io/en/latest/">PyGObject</a>: for the GTK-based backends <aclass="footnote-reference brackets" href="#id7" id="id4">2</a>.</p></li>
<li><p><aclass="reference external" href="https://www.wxpython.org/">wxPython</a> (>= 4) <aclass="footnote-reference brackets" href="#id8" id="id5">3</a>: for the wx-based backends.</p></li>
<li><p><aclass="reference external" href="https://pycairo.readthedocs.io/en/latest/">pycairo</a> (>= 1.11.0) or <aclass="reference external" href="https://cairocffi.readthedocs.io/en/latest/">cairocffi</a> (>= 0.8): for the GTK and/or cairo-based
backends.</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/tornado/">Tornado</a> (>=5): for the WebAgg backend.</p></li>
<dd><p>If using pip (and not conda) on Linux, wxPython wheels must be manually
downloaded from <aclass="reference external" href="https://wxpython.org/pages/downloads/">https://wxpython.org/pages/downloads/</a>.</p>
</dd>
</dl>
</section>
<sectionid="animations">
<h4>Animations<aclass="headerlink" href="#animations" title="Permalink to this headline">#</a></h4>
<ulclass="simple">
<li><p><aclass="reference external" href="https://www.ffmpeg.org/">ffmpeg</a>: for saving movies.</p></li>
<li><p><aclass="reference external" href="https://www.imagemagick.org/script/index.php">ImageMagick</a>: for saving
animated gifs.</p></li>
</ul>
</section>
<sectionid="font-handling-and-rendering">
<h4>Font handling and rendering<aclass="headerlink" href="#font-handling-and-rendering" title="Permalink to this headline">#</a></h4>
<ulclass="simple">
<li><p><aclass="reference external" href="https://www.latex-project.org/">LaTeX</a> (with <aclass="reference external" href="https://ctan.org/pkg/cm-super">cm-super</a> ) and <aclass="reference external" href="https://ghostscript.com/download/">GhostScript (>=9.0)</a> : for rendering text with LaTeX.</p></li>
<li><p><aclass="reference external" href="https://www.fontconfig.org">fontconfig</a> (>= 2.7): for detection of system
fonts on Linux.</p></li>
</ul>
</section>
</section>
<sectionid="c-libraries">
<h3>C libraries<aclass="headerlink" href="#c-libraries" title="Permalink to this headline">#</a></h3>
<p>Matplotlib brings its own copies of the following libraries:</p>
<ulclass="simple">
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Agg</span></code>: the Anti-Grain Geometry C++ rendering engine</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">ttconv</span></code>: a TrueType font utility</p></li>
</ul>
<p>Additionally, Matplotlib depends on:</p>
<ulclass="simple">
<li><p><aclass="reference external" href="https://www.freetype.org/">FreeType</a> (>= 2.3): a font rendering library</p></li>
<li><p><aclass="reference external" href="http://www.qhull.org/">QHull</a> (>= 2020.2): a library for computing triangulations</p></li>
</ul>
<p>By default, Matplotlib downloads and builds its own copies of FreeType (this is
necessary to run the test suite, because different versions of FreeType
rasterize characters differently) and of Qhull. As an exception, Matplotlib
defaults to the system version of FreeType on AIX.</p>
<p>To force Matplotlib to use a copy of FreeType or Qhull already installed in
your system, create a <codeclass="file docutils literal notranslate"><spanclass="pre">mplsetup.cfg</span></code> file with the following contents:</p>
brew install freetype <spanclass="c1"># macOS with Homebrew</span>
conda install freetype <spanclass="c1"># conda, any OS</span>
</pre></div>
</div>
<p>(adapt accordingly for Qhull).</p>
<p>On Linux and macOS, it is also recommended to install <aclass="reference external" href="https://www.freedesktop.org/wiki/Software/pkg-config/">pkg-config</a>, a helper
tool for locating FreeType:</p>
<divclass="highlight-sh notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># Pick ONE of the following:</span>
<spanid="development-dependencies"></span><h2>Additional dependencies for development<aclass="headerlink" href="#additional-dependencies-for-development" title="Permalink to this headline">#</a></h2>
</section>
<sectionid="additional-dependencies-for-testing">
<spanid="test-dependencies"></span><h2>Additional dependencies for testing<aclass="headerlink" href="#additional-dependencies-for-testing" title="Permalink to this headline">#</a></h2>
<p>This section lists the additional software required for
<aclass="reference internal" href="testing.html#testing"><spanclass="std std-ref">running the tests</span></a>.</p>
<li><p><aclass="reference external" href="https://pytest-cov.readthedocs.io/en/latest/">pytest-cov</a> (>=2.3.1) to collect coverage information</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/pytest-flake8/">pytest-flake8</a> to test coding standards using <aclass="reference external" href="https://pypi.org/project/flake8/">flake8</a></p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/pytest-timeout/">pytest-timeout</a> to limit runtime in case of stuck tests</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/pytest-xdist/">pytest-xdist</a> to run tests in parallel</p></li>
<spanid="doc-dependencies"></span><h2>Additional dependencies for building documentation<aclass="headerlink" href="#additional-dependencies-for-building-documentation" title="Permalink to this headline">#</a></h2>
<sectionid="python-packages">
<h3>Python packages<aclass="headerlink" href="#python-packages" title="Permalink to this headline">#</a></h3>
<p>The additional Python packages required to build the
<aclass="reference internal" href="documenting_mpl.html#documenting-matplotlib"><spanclass="std std-ref">documentation</span></a> are listed in
<codeclass="file docutils literal notranslate"><spanclass="pre">doc-requirements.txt</span></code> and can be installed using</p>
<li><p>the font "Times New Roman"</p></li>
</ul>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<p>The documentation will not build without LaTeX and Graphviz. These are not
Python packages and must be installed separately. The documentation can be
built without Inkscape and optipng, but the build process will raise various
warnings. If the build process warns that you are missing fonts, make sure
your LaTeX distribution bundles cm-super or install it separately.</p>
</div>
</section>
</section>
</section>
</div>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<divid="unreleased-message"> You are reading an old version of the documentation (v3.5.3). For the latest version see <ahref="https://matplotlib.org/stable/devel/dependencies.html">https://matplotlib.org/stable/devel/dependencies.html</a></div>