<p dir="auto">I want to plot this simple code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import matplotlib.pyplot as plt

# Example data
t = np.arange(0.0, 1.0 + 0.01, 0.01)
s = np.cos(4 * np.pi * t) + 2

plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.plot(t, s)

plt.xlabel(r'\textbf{time} (s)')
plt.ylabel(r'\textit{voltage} (mV)',fontsize=16)
plt.title(r&quot;\TeX\ is Number &quot;
          r&quot;$\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!&quot;,
          fontsize=16, color='gray')
# Make room for the ridiculously large title.
plt.subplots_adjust(top=0.8)

plt.savefig('tex_demo')
plt.show()
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<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>

<span class="pl-c"># Example data</span>
<span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span> <span class="pl-c1">+</span> <span class="pl-c1">0.01</span>, <span class="pl-c1">0.01</span>)
<span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">cos</span>(<span class="pl-c1">4</span> <span class="pl-c1">*</span> <span class="pl-s1">np</span>.<span class="pl-s1">pi</span> <span class="pl-c1">*</span> <span class="pl-s1">t</span>) <span class="pl-c1">+</span> <span class="pl-c1">2</span>

<span class="pl-s1">plt</span>.<span class="pl-en">rc</span>(<span class="pl-s">'text'</span>, <span class="pl-s1">usetex</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">rc</span>(<span class="pl-s">'font'</span>, <span class="pl-s1">family</span><span class="pl-c1">=</span><span class="pl-s">'serif'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(<span class="pl-s1">t</span>, <span class="pl-s1">s</span>)

<span class="pl-s1">plt</span>.<span class="pl-en">xlabel</span>(<span class="pl-s">r'\textbf{time} (s)'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">ylabel</span>(<span class="pl-s">r'\textit{voltage} (mV)'</span>,<span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">16</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">title</span>(<span class="pl-s">r"\TeX\ is Number "</span>
          <span class="pl-s">r"$\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!"</span>,
          <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">16</span>, <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s">'gray'</span>)
<span class="pl-c"># Make room for the ridiculously large title.</span>
<span class="pl-s1">plt</span>.<span class="pl-en">subplots_adjust</span>(<span class="pl-s1">top</span><span class="pl-c1">=</span><span class="pl-c1">0.8</span>)

<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'tex_demo'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<p dir="auto">the face the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="runfile('C:/Workspace/jaza0001/untitled0.py', wdir='C:/Workspace/jaza0001')
Traceback (most recent call last):

  File &quot;&lt;ipython-input-13-2954d5a98220&gt;&quot;, line 1, in &lt;module&gt;
    runfile('C:/Workspace/jaza0001/untitled0.py', wdir='C:/Workspace/jaza0001')

  File &quot;C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py&quot;, line 704, in runfile
    execfile(filename, namespace)

  File &quot;C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py&quot;, line 108, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File &quot;C:/Workspace/jaza0001/untitled0.py&quot;, line 20, in &lt;module&gt;
    plt.savefig('tex_demo')

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\pyplot.py&quot;, line 689, in savefig
    res = fig.savefig(*args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\figure.py&quot;, line 2094, in savefig
    self.canvas.print_figure(fname, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backend_bases.py&quot;, line 2075, in print_figure
    **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py&quot;, line 510, in print_png
    FigureCanvasAgg.draw(self)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py&quot;, line 402, in draw
    self.figure.draw(self.renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py&quot;, line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\figure.py&quot;, line 1649, in draw
    renderer, self, artists, self.suppressComposite)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py&quot;, line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py&quot;, line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\axes\_base.py&quot;, line 2628, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py&quot;, line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py&quot;, line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py&quot;, line 1187, in draw
    renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py&quot;, line 1125, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py&quot;, line 930, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py&quot;, line 313, in _get_layout
    ismath=ismath)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py&quot;, line 209, in get_text_width_height_descent
    s, fontsize, renderer=self)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py&quot;, line 464, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py&quot;, line 328, in make_dvi
    texfile], tex)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py&quot;, line 298, in _run_checked_subprocess
    stderr=subprocess.STDOUT)

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 389, in check_output
    **kwargs).stdout

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 466, in run
    with Popen(*popenargs, **kwargs) as process:

  File &quot;C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py&quot;, line 171, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 769, in __init__
    restore_signals, start_new_session)

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 1172, in _execute_child
    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified

Error in callback &lt;function install_repl_displayhook.&lt;locals&gt;.post_execute at 0x000001C8A5C1E6A8&gt; (for post_execute):
Traceback (most recent call last):

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\pyplot.py&quot;, line 109, in post_execute
    draw_all()

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\_pylab_helpers.py&quot;, line 132, in draw_all
    f_mgr.canvas.draw_idle()

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backend_bases.py&quot;, line 1899, in draw_idle
    self.draw(*args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py&quot;, line 402, in draw
    self.figure.draw(self.renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py&quot;, line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\figure.py&quot;, line 1649, in draw
    renderer, self, artists, self.suppressComposite)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py&quot;, line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py&quot;, line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\axes\_base.py&quot;, line 2628, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py&quot;, line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py&quot;, line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py&quot;, line 1187, in draw
    renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py&quot;, line 1125, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py&quot;, line 930, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py&quot;, line 313, in _get_layout
    ismath=ismath)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py&quot;, line 209, in get_text_width_height_descent
    s, fontsize, renderer=self)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py&quot;, line 464, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py&quot;, line 328, in make_dvi
    texfile], tex)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py&quot;, line 298, in _run_checked_subprocess
    stderr=subprocess.STDOUT)

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 389, in check_output
    **kwargs).stdout

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 466, in run
    with Popen(*popenargs, **kwargs) as process:

  File &quot;C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py&quot;, line 171, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 769, in __init__
    restore_signals, start_new_session)

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 1172, in _execute_child
    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified

Traceback (most recent call last):

  File &quot;C:\Temp\Anaconda\lib\site-packages\IPython\core\formatters.py&quot;, line 341, in __call__
    return printer(obj)

  File &quot;C:\Temp\Anaconda\lib\site-packages\IPython\core\pylabtools.py&quot;, line 244, in &lt;lambda&gt;
    png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))

  File &quot;C:\Temp\Anaconda\lib\site-packages\IPython\core\pylabtools.py&quot;, line 128, in print_figure
    fig.canvas.print_figure(bytes_io, **kw)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backend_bases.py&quot;, line 2049, in print_figure
    **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py&quot;, line 510, in print_png
    FigureCanvasAgg.draw(self)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py&quot;, line 402, in draw
    self.figure.draw(self.renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py&quot;, line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\figure.py&quot;, line 1649, in draw
    renderer, self, artists, self.suppressComposite)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py&quot;, line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py&quot;, line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\axes\_base.py&quot;, line 2628, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py&quot;, line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py&quot;, line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py&quot;, line 1187, in draw
    renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py&quot;, line 1125, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py&quot;, line 930, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py&quot;, line 313, in _get_layout
    ismath=ismath)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py&quot;, line 209, in get_text_width_height_descent
    s, fontsize, renderer=self)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py&quot;, line 464, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py&quot;, line 328, in make_dvi
    texfile], tex)

  File &quot;C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py&quot;, line 298, in _run_checked_subprocess
    stderr=subprocess.STDOUT)

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 389, in check_output
    **kwargs).stdout

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 466, in run
    with Popen(*popenargs, **kwargs) as process:

  File &quot;C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py&quot;, line 171, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 769, in __init__
    restore_signals, start_new_session)

  File &quot;C:\Temp\Anaconda\lib\subprocess.py&quot;, line 1172, in _execute_child
    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified

&lt;Figure size 432x288 with 1 Axes&gt;
"><pre class="notranslate"><code class="notranslate">runfile('C:/Workspace/jaza0001/untitled0.py', wdir='C:/Workspace/jaza0001')
Traceback (most recent call last):

  File "&lt;ipython-input-13-2954d5a98220&gt;", line 1, in &lt;module&gt;
    runfile('C:/Workspace/jaza0001/untitled0.py', wdir='C:/Workspace/jaza0001')

  File "C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile
    execfile(filename, namespace)

  File "C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Workspace/jaza0001/untitled0.py", line 20, in &lt;module&gt;
    plt.savefig('tex_demo')

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\pyplot.py", line 689, in savefig
    res = fig.savefig(*args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\figure.py", line 2094, in savefig
    self.canvas.print_figure(fname, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backend_bases.py", line 2075, in print_figure
    **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py", line 510, in print_png
    FigureCanvasAgg.draw(self)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py", line 402, in draw
    self.figure.draw(self.renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\figure.py", line 1649, in draw
    renderer, self, artists, self.suppressComposite)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\axes\_base.py", line 2628, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py", line 1187, in draw
    renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py", line 1125, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py", line 930, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py", line 313, in _get_layout
    ismath=ismath)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py", line 209, in get_text_width_height_descent
    s, fontsize, renderer=self)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py", line 464, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py", line 328, in make_dvi
    texfile], tex)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py", line 298, in _run_checked_subprocess
    stderr=subprocess.STDOUT)

  File "C:\Temp\Anaconda\lib\subprocess.py", line 389, in check_output
    **kwargs).stdout

  File "C:\Temp\Anaconda\lib\subprocess.py", line 466, in run
    with Popen(*popenargs, **kwargs) as process:

  File "C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 171, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File "C:\Temp\Anaconda\lib\subprocess.py", line 769, in __init__
    restore_signals, start_new_session)

  File "C:\Temp\Anaconda\lib\subprocess.py", line 1172, in _execute_child
    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified

Error in callback &lt;function install_repl_displayhook.&lt;locals&gt;.post_execute at 0x000001C8A5C1E6A8&gt; (for post_execute):
Traceback (most recent call last):

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\pyplot.py", line 109, in post_execute
    draw_all()

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\_pylab_helpers.py", line 132, in draw_all
    f_mgr.canvas.draw_idle()

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backend_bases.py", line 1899, in draw_idle
    self.draw(*args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py", line 402, in draw
    self.figure.draw(self.renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\figure.py", line 1649, in draw
    renderer, self, artists, self.suppressComposite)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\axes\_base.py", line 2628, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py", line 1187, in draw
    renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py", line 1125, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py", line 930, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py", line 313, in _get_layout
    ismath=ismath)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py", line 209, in get_text_width_height_descent
    s, fontsize, renderer=self)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py", line 464, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py", line 328, in make_dvi
    texfile], tex)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py", line 298, in _run_checked_subprocess
    stderr=subprocess.STDOUT)

  File "C:\Temp\Anaconda\lib\subprocess.py", line 389, in check_output
    **kwargs).stdout

  File "C:\Temp\Anaconda\lib\subprocess.py", line 466, in run
    with Popen(*popenargs, **kwargs) as process:

  File "C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 171, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File "C:\Temp\Anaconda\lib\subprocess.py", line 769, in __init__
    restore_signals, start_new_session)

  File "C:\Temp\Anaconda\lib\subprocess.py", line 1172, in _execute_child
    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified

Traceback (most recent call last):

  File "C:\Temp\Anaconda\lib\site-packages\IPython\core\formatters.py", line 341, in __call__
    return printer(obj)

  File "C:\Temp\Anaconda\lib\site-packages\IPython\core\pylabtools.py", line 244, in &lt;lambda&gt;
    png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))

  File "C:\Temp\Anaconda\lib\site-packages\IPython\core\pylabtools.py", line 128, in print_figure
    fig.canvas.print_figure(bytes_io, **kw)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backend_bases.py", line 2049, in print_figure
    **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py", line 510, in print_png
    FigureCanvasAgg.draw(self)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py", line 402, in draw
    self.figure.draw(self.renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\figure.py", line 1649, in draw
    renderer, self, artists, self.suppressComposite)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\axes\_base.py", line 2628, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py", line 1187, in draw
    renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\axis.py", line 1125, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py", line 930, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\text.py", line 313, in _get_layout
    ismath=ismath)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\backends\backend_agg.py", line 209, in get_text_width_height_descent
    s, fontsize, renderer=self)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py", line 464, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py", line 328, in make_dvi
    texfile], tex)

  File "C:\Temp\Anaconda\lib\site-packages\matplotlib\texmanager.py", line 298, in _run_checked_subprocess
    stderr=subprocess.STDOUT)

  File "C:\Temp\Anaconda\lib\subprocess.py", line 389, in check_output
    **kwargs).stdout

  File "C:\Temp\Anaconda\lib\subprocess.py", line 466, in run
    with Popen(*popenargs, **kwargs) as process:

  File "C:\Temp\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 171, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File "C:\Temp\Anaconda\lib\subprocess.py", line 769, in __init__
    restore_signals, start_new_session)

  File "C:\Temp\Anaconda\lib\subprocess.py", line 1172, in _execute_child
    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified

&lt;Figure size 432x288 with 1 Axes&gt;

</code></pre></div>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong><br>
I am unable to <code class="notranslate">import matplotlib.pyplot</code> starting in version 3.0.0. Might be related to Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="267084262" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/9485" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/9485/hovercard" href="https://github.com/matplotlib/matplotlib/issues/9485">#9485</a>?</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>
<p dir="auto">I get the following traceback when executing the above <code class="notranslate">import</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py&quot;, line 1353, in &lt;module&gt;
    fontManager = json_load(_fmcache)
  File &quot;C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py&quot;, line 888, in json_load
    with open(filename, 'r') as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\username\\.matplotlib\\fontlist-v300.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;&lt;pyshell#0&gt;&quot;, line 1, in &lt;module&gt;
    import matplotlib.pyplot as plt
  File &quot;C:\Python\Python35\lib\site-packages\matplotlib\pyplot.py&quot;, line 32, in &lt;module&gt;
    import matplotlib.colorbar
  File &quot;C:\Python\Python35\lib\site-packages\matplotlib\colorbar.py&quot;, line 32, in &lt;module&gt;
    import matplotlib.contour as contour
  File &quot;C:\Python\Python35\lib\site-packages\matplotlib\contour.py&quot;, line 18, in &lt;module&gt;
    import matplotlib.font_manager as font_manager
  File &quot;C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py&quot;, line 1363, in &lt;module&gt;
    _rebuild()
  File &quot;C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py&quot;, line 1344, in _rebuild
    fontManager = FontManager()
  File &quot;C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py&quot;, line 978, in __init__
    ttffiles = findSystemFonts(paths) + findSystemFonts()
  File &quot;C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py&quot;, line 264, in findSystemFonts
    fontfiles.update(win32InstalledFonts(fontext=fontext))
TypeError: 'NoneType' object is not iterable"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py", line 1353, in &lt;module&gt;
    fontManager = json_load(_fmcache)
  File "C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py", line 888, in json_load
    with open(filename, 'r') as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\username\\.matplotlib\\fontlist-v300.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "&lt;pyshell#0&gt;", line 1, in &lt;module&gt;
    import matplotlib.pyplot as plt
  File "C:\Python\Python35\lib\site-packages\matplotlib\pyplot.py", line 32, in &lt;module&gt;
    import matplotlib.colorbar
  File "C:\Python\Python35\lib\site-packages\matplotlib\colorbar.py", line 32, in &lt;module&gt;
    import matplotlib.contour as contour
  File "C:\Python\Python35\lib\site-packages\matplotlib\contour.py", line 18, in &lt;module&gt;
    import matplotlib.font_manager as font_manager
  File "C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py", line 1363, in &lt;module&gt;
    _rebuild()
  File "C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py", line 1344, in _rebuild
    fontManager = FontManager()
  File "C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py", line 978, in __init__
    ttffiles = findSystemFonts(paths) + findSystemFonts()
  File "C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py", line 264, in findSystemFonts
    fontfiles.update(win32InstalledFonts(fontext=fontext))
TypeError: 'NoneType' object is not iterable
</code></pre></div>
<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: Windows 10 64-bit</li>
<li>Matplotlib version: 3.0.0</li>
<li>Matplotlib backend: TkAgg</li>
<li>Python version: 3.5.4</li>
<li>Jupyter version (if applicable): NA</li>
<li>Other libraries: NA</li>
</ul>
<p dir="auto">Installed via <code class="notranslate">pip</code></p>