<spanid="install-from-source"></span><h2>Installing a nightly build<aclass="headerlink" href="#installing-a-nightly-build" title="Permalink to this heading">#</a></h2>
<p>Matplotlib makes nightly development build wheels available on the
<h2>Installing from source<aclass="headerlink" href="#installing-from-source" title="Permalink to this heading">#</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.</p>
<p>First you need to install the <aclass="reference internal" href="../../devel/dependencies.html#dependencies"><spanclass="std std-ref">Dependencies</span></a>.</p>
<p>A C compiler is required. Typically, on Linux, you will need <codeclass="docutils literal notranslate"><spanclass="pre">gcc</span></code>, which
should be installed using your distribution's package manager; on macOS, you
will need <aclass="reference external" href="https://guide.macports.org/chunked/installing.html#installing.xcode">xcode</a>; on Windows, you will need <aclass="reference external" href="https://visualstudio.microsoft.com/downloads/">Visual Studio</a> 2015 or later.</p>
<p>For those using Visual Studio, make sure "Desktop development with C++" is
selected, and that the latest MSVC, "C++ CMake tools for Windows," and a
Windows SDK compatible with your version of Windows are selected and installed.
They should be selected by default under the "Optional" subheading, but are
required to build matplotlib from source.</p>
<p>The easiest way to get the latest development version to start contributing
is to go to the git <aclass="reference external" href="https://github.com/matplotlib/matplotlib">repository</a>
<p>When you run <codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">pull</span></code>, if the output shows that only Python files have
been updated, you are all set. If C files have changed, you need to run <codeclass="docutils literal notranslate"><spanclass="pre">pip</span>
<spanclass="pre">install</span><spanclass="pre">-e</span><spanclass="pre">.</span></code> again to compile them.</p>
<p>There is more information on <aclass="reference internal" href="../../devel/gitwash/index.html#using-git"><spanclass="std std-ref">using git</span></a> in the developer
docs.</p>
<divclass="admonition warning">
<pclass="admonition-title">Warning</p>
<p>The following instructions in this section are for very custom
installations of Matplotlib. Proceed with caution because these instructions
may result in your build producing unexpected behavior and/or causing
local testing to fail.</p>
</div>
<p>If you would like to build from a tarball, grab the latest <em>tar.gz</em> release
file from <aclass="reference external" href="https://pypi.org/project/matplotlib/">the PyPI files page</a>.</p>
<p>We provide a <aclass="reference external" href="https://raw.githubusercontent.com/matplotlib/matplotlib/main/mplsetup.cfg.template">mplsetup.cfg</a> file 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 are building your own Matplotlib wheels (or sdists) on Windows, note
that any DLLs that you copy into the source tree will be packaged too.</p>
</section>
<sectionid="installing-for-development">
<h2>Installing for development<aclass="headerlink" href="#installing-for-development" title="Permalink to this heading">#</a></h2>
<p>See <aclass="reference internal" href="../../devel/development_setup.html#installing-for-devs"><spanclass="std std-ref">Setting up Matplotlib for development</span></a>.</p>
</section>
<sectionid="frequently-asked-questions">
<spanid="installing-faq"></span><h2>Frequently asked questions<aclass="headerlink" href="#frequently-asked-questions" title="Permalink to this heading">#</a></h2>
<navclass="contents local" id="contents">
<ulclass="simple">
<li><p><aclass="reference internal" href="#report-a-compilation-problem" id="id3">Report a compilation problem</a></p></li>
<li><p><aclass="reference internal" href="#matplotlib-compiled-fine-but-nothing-shows-up-when-i-use-it" id="id4">Matplotlib compiled fine, but nothing shows up when I use it</a></p></li>
<li><p><aclass="reference internal" href="#how-to-completely-remove-matplotlib" id="id5">How to completely remove Matplotlib</a></p></li>
<h3>Matplotlib compiled fine, but nothing shows up when I use it<aclass="headerlink" href="#matplotlib-compiled-fine-but-nothing-shows-up-when-i-use-it" title="Permalink to this heading">#</a></h3>
<p>The first thing to try is a <aclass="reference internal" href="#clean-install"><spanclass="std std-ref">clean install</span></a> and see if
that helps. If not, the best way to test your install is by running a script,
rather than working interactively from a python shell or an integrated
development environment such as <strongclass="program">IDLE</strong> which add additional
complexities. Open up a UNIX shell or a DOS command prompt and run, for
<p>This will give you additional information about which backends Matplotlib is
loading, version information, and more. At this point you might want to make
sure you understand Matplotlib's <aclass="reference internal" href="../../tutorials/introductory/customizing.html"><spanclass="doc">configuration</span></a>
process, governed by the <codeclass="file docutils literal notranslate"><spanclass="pre">matplotlibrc</span></code> configuration file which contains
instructions within and the concept of the Matplotlib backend.</p>
<p>If you are still having trouble, see <aclass="reference internal" href="../faq/troubleshooting_faq.html#reporting-problems"><spanclass="std std-ref">Getting help</span></a>.</p>
</section>
<sectionid="how-to-completely-remove-matplotlib">
<spanid="clean-install"></span><h3>How to completely remove Matplotlib<aclass="headerlink" href="#how-to-completely-remove-matplotlib" title="Permalink to this heading">#</a></h3>
<p>Occasionally, problems with Matplotlib can be solved with a clean
installation of the package. In order to fully remove an installed Matplotlib:</p>
<olclass="arabic simple">
<li><p>Delete the caches from your <aclass="reference internal" href="../faq/troubleshooting_faq.html#locating-matplotlib-config-dir"><spanclass="std std-ref">Matplotlib configuration directory</span></a>.</p></li>
<li><p>Delete any Matplotlib directories or eggs from your <aclass="reference internal" href="../faq/troubleshooting_faq.html#locating-matplotlib-install"><spanclass="std std-ref">installation
directory</span></a>.</p></li>
</ol>
</section>
<sectionid="osx-notes">
<h3>OSX Notes<aclass="headerlink" href="#osx-notes" title="Permalink to this heading">#</a></h3>
<sectionid="which-python-for-osx">
<spanid="id1"></span><h4>Which python for OSX?<aclass="headerlink" href="#which-python-for-osx" title="Permalink to this heading">#</a></h4>
<p>Apple ships OSX with its own Python, in <codeclass="docutils literal notranslate"><spanclass="pre">/usr/bin/python</span></code>, and its own copy
of Matplotlib. Unfortunately, the way Apple currently installs its own copies
of NumPy, Scipy and Matplotlib means that these packages are difficult to
upgrade (see <aclass="reference external" href="https://github.com/MacPython/wiki/wiki/Which-Python#system-python-and-extra-python-packages">system python packages</a>). For that reason we strongly suggest
that you install a fresh version of Python and use that as the basis for
installing libraries such as NumPy and Matplotlib. One convenient way to
install Matplotlib with other useful Python software is to use the <aclass="reference external" href="https://www.anaconda.com/">Anaconda</a>
Python scientific software collection, which includes Python itself and a
wide range of libraries; if you need a library that is not available from the
collection, you can install it yourself using standard methods such as <em>pip</em>.
See the Anaconda web page for installation support.</p>
<p>Other options for a fresh Python install are the standard installer from
<aclass="reference external" href="https://www.python.org/downloads/mac-osx/">python.org</a>, or installing
Python using a general OSX package management system such as <aclass="reference external" href="https://brew.sh/">homebrew</a> or <aclass="reference external" href="https://www.macports.org">macports</a>. Power users on
OSX will likely want one of homebrew or macports on their system to install
open source software packages, but it is perfectly possible to use these
systems with another source for your Python binary, such as Anaconda
or Python.org Python.</p>
</section>
<sectionid="installing-osx-binary-wheels">
<spanid="install-osx-binaries"></span><h4>Installing OSX binary wheels<aclass="headerlink" href="#installing-osx-binary-wheels" title="Permalink to this heading">#</a></h4>
<p>If you are using Python from <aclass="reference external" href="https://www.python.org">https://www.python.org</a>, Homebrew, or Macports,
then you can use the standard pip installer to install Matplotlib binaries in
the form of wheels.</p>
<p>pip is installed by default with python.org and Homebrew Python, but needs to
<p>You might also want to install IPython or the Jupyter notebook (<codeclass="docutils literal notranslate"><spanclass="pre">python3</span><spanclass="pre">-m</span><spanclass="pre">pip</span>
<p>If you get a result like <codeclass="docutils literal notranslate"><spanclass="pre">/usr/bin/python...</span></code>, then you are getting the
Python installed with OSX, which is probably not what you want. Try closing
and restarting Terminal.app before running the check again. If that doesn't fix
the problem, depending on which Python you wanted to use, consider reinstalling
Python.org Python, or check your homebrew or macports setup. Remember that
the disk image installer only works for Python.org Python, and will not get
picked up by other Pythons. If all these fail, please <aclass="reference internal" href="../faq/troubleshooting_faq.html#reporting-problems"><spanclass="std std-ref">let us know</span></a>.</p>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<divid="unreleased-message"> You are reading an old version of the documentation (v3.6.0). For the latest version see <ahref="https://matplotlib.org/stable/users/installing/index.html">https://matplotlib.org/stable/users/installing/index.html</a></div>