<divid="unreleased-message"> You are reading an old version of the documentation (v2.2.2). For the latest version see <ahref="/stable/">https://matplotlib.org/stable/</a></div>
<spanid="virtualenv-faq"></span><h1>Working with Matplotlib in Virtual environments<aclass="headerlink" href="#working-with-matplotlib-in-virtual-environments" title="Permalink to this headline">¶</a></h1>
<p>When running Matplotlib in a <aclass="reference external" href="https://virtualenv.pypa.io/en/latest/">virtual environment</a> you may discover a few issues.
Matplotlib itself has no issue with virtual environments. However, some of
the external GUI frameworks that Matplotlib uses for interactive figures may
be tricky to install in a virtual environment. Everything below assumes some
familiarity with the Matplotlib backends as found in <aclass="reference internal" href="../tutorials/introductory/usage.html#what-is-a-backend"><spanclass="std std-ref">What is a backend?</span></a>.</p>
<p>If you only use the IPython and Jupyter Notebook’s <codeclass="docutils literal notranslate"><spanclass="pre">inline</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">notebook</span></code>
backends, or non-interactive backends, you should not have any issues and can
ignore everything below.</p>
<p>Likewise, the <codeclass="docutils literal notranslate"><spanclass="pre">Tk</span></code> framework (<codeclass="docutils literal notranslate"><spanclass="pre">TkAgg</span></code> backend) does not require any
external dependencies and is normally always available. On certain Linux
distributions, a package named <codeclass="docutils literal notranslate"><spanclass="pre">python-tk</span></code> (or similar) needs to be
installed.</p>
<p>Otherwise, the situation (at the time of writing) is as follows:</p>