<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">Can't import matplotlib.pyplot</p>
<p dir="auto"><strong>Code for reproduction</strong></p>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span></pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# If applicable, paste the console output here
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
&lt;ipython-input-1-f09a4c6b4388&gt; in &lt;module&gt;()
      1 import numpy as np
----&gt; 2 import matplotlib.pyplot as plt
      3 import scipy.ndimage.imread as imread
      4 
      5 path = 'C:/data/cifar_10/train/15.png'

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\pyplot.py in &lt;module&gt;()
     30 from cycler import cycler
     31 import matplotlib
---&gt; 32 import matplotlib.colorbar
     33 from matplotlib import style
     34 from matplotlib import _pylab_helpers, interactive

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\colorbar.py in &lt;module&gt;()
     34 import matplotlib.collections as collections
     35 import matplotlib.colors as colors
---&gt; 36 import matplotlib.contour as contour
     37 import matplotlib.cm as cm
     38 import matplotlib.gridspec as gridspec

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\contour.py in &lt;module&gt;()
     19 import matplotlib.colors as colors
     20 import matplotlib.collections as mcoll
---&gt; 21 import matplotlib.font_manager as font_manager
     22 import matplotlib.text as text
     23 import matplotlib.cbook as cbook

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\font_manager.py in &lt;module&gt;()
     56 
     57 import matplotlib
---&gt; 58 from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
     59 from matplotlib.compat import subprocess
     60 from matplotlib.fontconfig_pattern import (

ImportError: DLL load failed: The specified procedure could not be found."><pre class="notranslate"><code class="notranslate"># If applicable, paste the console output here
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
&lt;ipython-input-1-f09a4c6b4388&gt; in &lt;module&gt;()
      1 import numpy as np
----&gt; 2 import matplotlib.pyplot as plt
      3 import scipy.ndimage.imread as imread
      4 
      5 path = 'C:/data/cifar_10/train/15.png'

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\pyplot.py in &lt;module&gt;()
     30 from cycler import cycler
     31 import matplotlib
---&gt; 32 import matplotlib.colorbar
     33 from matplotlib import style
     34 from matplotlib import _pylab_helpers, interactive

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\colorbar.py in &lt;module&gt;()
     34 import matplotlib.collections as collections
     35 import matplotlib.colors as colors
---&gt; 36 import matplotlib.contour as contour
     37 import matplotlib.cm as cm
     38 import matplotlib.gridspec as gridspec

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\contour.py in &lt;module&gt;()
     19 import matplotlib.colors as colors
     20 import matplotlib.collections as mcoll
---&gt; 21 import matplotlib.font_manager as font_manager
     22 import matplotlib.text as text
     23 import matplotlib.cbook as cbook

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\font_manager.py in &lt;module&gt;()
     56 
     57 import matplotlib
---&gt; 58 from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
     59 from matplotlib.compat import subprocess
     60 from matplotlib.fontconfig_pattern import (

ImportError: DLL load failed: The specified procedure could not be found.
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>


<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system:</li>
<li>Matplotlib version:</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>):</li>
<li>Python version:</li>
<li>Jupyter version (if applicable):</li>
<li>Other libraries:</li>
</ul>


<p dir="auto">Everything was installed via anaconda.</p>
<p dir="auto">Opening an issue on this to track progress and get insight from other people.</p>
<p dir="auto">I have just been playing with tests on my own system, and I have discovered that the tests don't run fully independently of each other...</p>
<p dir="auto">So far, I have only discovered problems with different backends getting used, for example in <code class="notranslate">test_backend_qt4.py</code> we have a few tests that have :</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="plt.switch_backend('Qt4Agg')"><pre class="notranslate"><span class="pl-s1">plt</span>.<span class="pl-en">switch_backend</span>(<span class="pl-s">'Qt4Agg'</span>)</pre></div>
<p dir="auto"><code class="notranslate">test_backend_pgf.py</code> seems to have the solution to this with a generic decorator, and it feels odd that such a beautifully generic decorator appears in a very specific class and doesn't get used elsewhere.</p>
<p dir="auto">Anyway I shall make a PR to correct this backend thing and hope we have no other inter-dependancies, but in the meantime, some questions:</p>
<ol dir="auto">
<li>Why don't we reset everything at the beginning of each test anyway, we have a <code class="notranslate">setup()</code> function that should do this?</li>
<li>Do we have an easy way to print debug information for tests?  I.e. specific rcParams?  This will help debugging future issues like this (touch wood we don't get any).</li>
</ol>