title: import matplotlib.pyplot hangs
body: <p>I'm trying to get matplotlib up and running on OS X 10.8.4. I've installed matplotlib and the dependencies (libping, freetype, numpy, scipy). I am able to import matplotlib just fine. However, if I try to import matplotlib.pyplot, it just hangs. There's no error, it's just that nothing happens.</p>
  
  <pre><code>&gt;&gt;&gt; import matplotlib.pyplot
  </code></pre>
  
  <p>...I've waited maybe 20 minutes an nothing happens. I'm using version 1.2.1, but even uninstalled that and tried version 1.2.0, but to no avail. I've seen a number of questions on SO about import errors with matplotlib.pyplot, but nothing where it just hangs. I then tried to get it working using the Enthought/Canopy python distribution, but again, the same hanging issue. Here's what I see if I kill the import:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/pyplot.py", line 26, in &lt;module&gt;
      from matplotlib.figure import Figure, figaspect
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/figure.py", line 34, in &lt;module&gt;
      import matplotlib.colorbar as cbar
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/colorbar.py", line 29, in &lt;module&gt;
      import matplotlib.collections as collections
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/collections.py", line 23, in &lt;module&gt;
      import matplotlib.backend_bases as backend_bases
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 37, in &lt;module&gt;
      import matplotlib.widgets as widgets
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/widgets.py", line 17, in &lt;module&gt;
      from lines import Line2D
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/lines.py", line 25, in &lt;module&gt;
      from matplotlib.font_manager import FontProperties
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1335, in &lt;module&gt;
      _rebuild()
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1322, in _rebuild
      fontManager = FontManager()
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/font_manager.py", line 980, in __init__
      self.ttffiles = findSystemFonts(paths) + findSystemFonts()
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/font_manager.py", line 317, in findSystemFonts
      for f in get_fontconfig_fonts(fontext):
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/matplotlib/font_manager.py", line 274, in get_fontconfig_fonts
      output = pipe.communicate()[0]
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/subprocess.py", line 746, in communicate
      stdout = _eintr_retry_call(self.stdout.read)
    File "/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/subprocess.py", line 478, in _eintr_retry_call
      return func(*args)
  KeyboardInterrupt
  </code></pre>
  
  <p>The output was the same when I was using the default python 2.7 that comes with OS X.</p>
  
  <h3>UPDATE</h3>
  
  <p>Allowing <code>import matplotlib.pyplot</code> to run for a few hours and then interrupting the import now gives me this output:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/Library/Python/2.7/site-packages/matplotlib/pyplot.py", line 26, in &lt;module&gt;
      from matplotlib.figure import Figure, figaspect
    File "/Library/Python/2.7/site-packages/matplotlib/figure.py", line 34, in &lt;module&gt;
      import matplotlib.colorbar as cbar
    File "/Library/Python/2.7/site-packages/matplotlib/colorbar.py", line 29, in &lt;module&gt;
      import matplotlib.collections as collections
    File "/Library/Python/2.7/site-packages/matplotlib/collections.py", line 23, in &lt;module&gt;
      import matplotlib.backend_bases as backend_bases
    File "/Library/Python/2.7/site-packages/matplotlib/backend_bases.py", line 37, in &lt;module&gt;
      import matplotlib.widgets as widgets
    File "/Library/Python/2.7/site-packages/matplotlib/widgets.py", line 17, in &lt;module&gt;
      from lines import Line2D
    File "/Library/Python/2.7/site-packages/matplotlib/lines.py", line 25, in &lt;module&gt;
      from matplotlib.font_manager import FontProperties
    File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 1335, in &lt;module&gt;
      _rebuild()
    File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 1322, in _rebuild
      fontManager = FontManager()
    File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 980, in __init__
      self.ttffiles = findSystemFonts(paths) + findSystemFonts()
    File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 324, in findSystemFonts
      files = list_fonts(path, fontexts)
    File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 171, in list_fonts
      return cbook.listFiles(directory, pattern)
    File "/Library/Python/2.7/site-packages/matplotlib/cbook.py", line 944, in listFiles
      for dirname, dirs, files in os.walk(root):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
      for x in walk(new_path, topdown, onerror, followlinks):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 284, in walk
      if isdir(join(top, name)):
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py", line 41, in isdir
      st = os.stat(s)
  KeyboardInterrupt
  </code></pre>
  
  <p>Does anyone know what the recursive <code>for x in walk(new_path, topdown, onerror, followlinks):</code> might indicate?</p>