<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>

<p dir="auto">I can find font_manager.py in my folder, but it cannot recognise that<br>
<strong>Code for reproduction</strong><br>
<code class="notranslate">import matplotlib</code></p>

<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
#
#
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in &lt;module&gt;()
   1352         try:
-&gt; 1353             fontManager = json_load(_fmcache)
   1354             if (not hasattr(fontManager, '_version') or

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in json_load(filename)
    887     &quot;&quot;&quot;
--&gt; 888     with open(filename, 'r') as fh:
    889         return json.load(fh, object_hook=_json_decode)

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\victor\\.matplotlib\\fontlist-v300.json'

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
&lt;ipython-input-1-5c78ffaa5488&gt; in &lt;module&gt;()
----&gt; 1 get_ipython().run_line_magic('matplotlib', 'inline')
      2 import pandas as pd

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
   2129                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2130             with self.builtin_trap:
-&gt; 2131                 result = fn(*args,**kwargs)
   2132             return result
   2133 

&lt;decorator-gen-108&gt; in matplotlib(self, line)

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\magic.py in &lt;lambda&gt;(f, *a, **k)
    185     # but it's overkill for just that one bit of state.
    186     def magic_deco(arg):
--&gt; 187         call = lambda f, *a, **k: f(*a, **k)
    188 
    189         if callable(arg):

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\magics\pylab.py in matplotlib(self, line)
     97             print(&quot;Available matplotlib backends: %s&quot; % backends_list)
     98         else:
---&gt; 99             gui, backend = self.shell.enable_matplotlib(args.gui)
    100             self._show_matplotlib_backend(args.gui, backend)
    101 

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\interactiveshell.py in enable_matplotlib(self, gui)
   3047                 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select)
   3048 
-&gt; 3049         pt.activate_matplotlib(backend)
   3050         pt.configure_inline_support(self, backend)
   3051 

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\pylabtools.py in activate_matplotlib(backend)
    308     matplotlib.rcParams['backend'] = backend
    309 
--&gt; 310     import matplotlib.pyplot
    311     matplotlib.pyplot.switch_backend(backend)
    312 

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\pyplot.py in &lt;module&gt;()
     30 from cycler import cycler
     31 import matplotlib
---&gt; 32 import matplotlib.colorbar
     33 import matplotlib.image
     34 from matplotlib import rcsetup, style

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\colorbar.py in &lt;module&gt;()
     30 import matplotlib.collections as collections
     31 import matplotlib.colors as colors
---&gt; 32 import matplotlib.contour as contour
     33 import matplotlib.cm as cm
     34 import matplotlib.gridspec as gridspec

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\contour.py in &lt;module&gt;()
     16 import matplotlib.colors as mcolors
     17 import matplotlib.collections as mcoll
---&gt; 18 import matplotlib.font_manager as font_manager
     19 import matplotlib.text as text
     20 import matplotlib.cbook as cbook

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in &lt;module&gt;()
   1361             raise
   1362         except Exception:
-&gt; 1363             _rebuild()
   1364     else:
   1365         _rebuild()

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in _rebuild()
   1342         global fontManager
   1343 
-&gt; 1344         fontManager = FontManager()
   1345 
   1346         if _fmcache:

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in __init__(self, size, weight)
    976         self.defaultFont = {}
    977 
--&gt; 978         ttffiles = findSystemFonts(paths) + findSystemFonts()
    979         self.defaultFont['ttf'] = next(
    980             (fname for fname in ttffiles

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in findSystemFonts(fontpaths, fontext)
    262             fontpaths = [win32FontDirectory()]
    263             # now get all installed fonts directly...
--&gt; 264             fontfiles.update(win32InstalledFonts(fontext=fontext))
    265         else:
    266             fontpaths = X11FontDirectories

TypeError: 'NoneType' object is not iterable
"><pre class="notranslate"><code class="notranslate"># If applicable, paste the console output here
#
#
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in &lt;module&gt;()
   1352         try:
-&gt; 1353             fontManager = json_load(_fmcache)
   1354             if (not hasattr(fontManager, '_version') or

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in json_load(filename)
    887     """
--&gt; 888     with open(filename, 'r') as fh:
    889         return json.load(fh, object_hook=_json_decode)

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\victor\\.matplotlib\\fontlist-v300.json'

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
&lt;ipython-input-1-5c78ffaa5488&gt; in &lt;module&gt;()
----&gt; 1 get_ipython().run_line_magic('matplotlib', 'inline')
      2 import pandas as pd

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
   2129                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2130             with self.builtin_trap:
-&gt; 2131                 result = fn(*args,**kwargs)
   2132             return result
   2133 

&lt;decorator-gen-108&gt; in matplotlib(self, line)

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\magic.py in &lt;lambda&gt;(f, *a, **k)
    185     # but it's overkill for just that one bit of state.
    186     def magic_deco(arg):
--&gt; 187         call = lambda f, *a, **k: f(*a, **k)
    188 
    189         if callable(arg):

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\magics\pylab.py in matplotlib(self, line)
     97             print("Available matplotlib backends: %s" % backends_list)
     98         else:
---&gt; 99             gui, backend = self.shell.enable_matplotlib(args.gui)
    100             self._show_matplotlib_backend(args.gui, backend)
    101 

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\interactiveshell.py in enable_matplotlib(self, gui)
   3047                 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select)
   3048 
-&gt; 3049         pt.activate_matplotlib(backend)
   3050         pt.configure_inline_support(self, backend)
   3051 

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\IPython\core\pylabtools.py in activate_matplotlib(backend)
    308     matplotlib.rcParams['backend'] = backend
    309 
--&gt; 310     import matplotlib.pyplot
    311     matplotlib.pyplot.switch_backend(backend)
    312 

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\pyplot.py in &lt;module&gt;()
     30 from cycler import cycler
     31 import matplotlib
---&gt; 32 import matplotlib.colorbar
     33 import matplotlib.image
     34 from matplotlib import rcsetup, style

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\colorbar.py in &lt;module&gt;()
     30 import matplotlib.collections as collections
     31 import matplotlib.colors as colors
---&gt; 32 import matplotlib.contour as contour
     33 import matplotlib.cm as cm
     34 import matplotlib.gridspec as gridspec

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\contour.py in &lt;module&gt;()
     16 import matplotlib.colors as mcolors
     17 import matplotlib.collections as mcoll
---&gt; 18 import matplotlib.font_manager as font_manager
     19 import matplotlib.text as text
     20 import matplotlib.cbook as cbook

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in &lt;module&gt;()
   1361             raise
   1362         except Exception:
-&gt; 1363             _rebuild()
   1364     else:
   1365         _rebuild()

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in _rebuild()
   1342         global fontManager
   1343 
-&gt; 1344         fontManager = FontManager()
   1345 
   1346         if _fmcache:

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in __init__(self, size, weight)
    976         self.defaultFont = {}
    977 
--&gt; 978         ttffiles = findSystemFonts(paths) + findSystemFonts()
    979         self.defaultFont['ttf'] = next(
    980             (fname for fname in ttffiles

c:\users\victor\appdata\local\programs\python\python35\lib\site-packages\matplotlib\font_manager.py in findSystemFonts(fontpaths, fontext)
    262             fontpaths = [win32FontDirectory()]
    263             # now get all installed fonts directly...
--&gt; 264             fontfiles.update(win32InstalledFonts(fontext=fontext))
    265         else:
    266             fontpaths = X11FontDirectories

TypeError: 'NoneType' object is not iterable

</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: Win10</li>
<li>Matplotlib version: 3.0.0</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>):</li>
<li>Python version: 3.5</li>
<li>Jupyter version (if applicable):</li>
<li>Other libraries:</li>
</ul>
<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>