nwhitehead / pineapple

http://nwhitehead.github.io/pineapple/
Other
351 stars 26 forks source link

matplotlib import error #59

Closed rmomizo closed 8 years ago

rmomizo commented 8 years ago

I am having trouble running matplotlib in pineapple. Each time that I import the module, I receive the following font_manager error:

/pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.

warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

FileNotFoundError Traceback (most recent call last) /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py in () 1412 try: -> 1413 fontManager = pickle_load(_fmcache) 1414 if (not hasattr(fontManager, '_version') or

/pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py in pickle_load(filename) 963 """ --> 964 with open(filename, 'rb') as fh: 965 data = pickle.load(fh)

FileNotFoundError: [Errno 2] No such file or directory: '/.matplotlib/fontList.py3k.cache'

During handling of the above exception, another exception occurred:

PermissionError Traceback (most recent call last)

in () ----> 1 get_ipython().magic('matplotlib inline') 2 import matplotlib.pyplot as plt 3 /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s) 2161 magic_name, _, magic_arg_s = arg_s.partition(' ') 2162 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC) -> 2163 return self.run_line_magic(magic_name, magic_arg_s) 2164 2165 #------------------------------------------------------------------------- /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line) 2082 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals 2083 with self.builtin_trap: -> 2084 result = fn(_args,_*kwargs) 2085 return result 2086 in matplotlib(self, line) /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/magic.py in (f, _a, *_k) 191 # but it's overkill for just that one bit of state. 192 def magic_deco(arg): --> 193 call = lambda f, _a, *_k: f(_a, *_k) 194 195 if callable(arg): /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/magics/pylab.py in matplotlib(self, line) 98 print("Available matplotlib backends: %s" % backends_list) 99 else: --> 100 gui, backend = self.shell.enable_matplotlib(args.gui) 101 self._show_matplotlib_backend(args.gui, backend) 102 /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/interactiveshell.py in enable_matplotlib(self, gui) 2949 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select) 2950 -> 2951 pt.activate_matplotlib(backend) 2952 pt.configure_inline_support(self, backend) 2953 /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/pylabtools.py in activate_matplotlib(backend) 291 matplotlib.rcParams['backend'] = backend 292 --> 293 import matplotlib.pyplot 294 matplotlib.pyplot.switch_backend(backend) 295 /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py in () 27 from cycler import cycler 28 import matplotlib ---> 29 import matplotlib.colorbar 30 from matplotlib import style 31 from matplotlib import _pylab_helpers, interactive /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/colorbar.py in () 32 import matplotlib.artist as martist 33 import matplotlib.cbook as cbook ---> 34 import matplotlib.collections as collections 35 import matplotlib.colors as colors 36 import matplotlib.contour as contour pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/collections.py in () 25 import matplotlib.artist as artist 26 from matplotlib.artist import allow_rasterization ---> 27 import matplotlib.backend_bases as backend_bases 28 import matplotlib.path as mpath 29 from matplotlib import _path /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/backend_bases.py in () 60 61 import matplotlib.tight_bbox as tight_bbox ---> 62 import matplotlib.textpath as textpath 63 from matplotlib.path import Path 64 from matplotlib.cbook import mplDeprecation, warn_deprecated /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/textpath.py in () 13 from matplotlib.path import Path 14 from matplotlib import rcParams ---> 15 import matplotlib.font_manager as font_manager 16 from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING 17 from matplotlib.ft2font import LOAD_TARGET_LIGHT /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py in () 1419 verbose.report("Using fontManager instance from %s" % _fmcache) 1420 except: -> 1421 _rebuild() 1422 else: 1423 _rebuild() /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py in _rebuild() 1404 def _rebuild(): 1405 global fontManager -> 1406 fontManager = FontManager() 1407 if _fmcache: 1408 pickle_dump(fontManager, _fmcache) /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py in **init**(self, size, weight) 1057 self.defaultFont['ttf'] = self.ttffiles[0] 1058 -> 1059 self.ttflist = createFontList(self.ttffiles) 1060 1061 self.afmfiles = findSystemFonts(paths, fontext='afm') + \ /pineapple-master/build/Pineapple.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py in createFontList(fontfiles, fontext) 579 else: 580 try: --> 581 font = ft2font.FT2Font(fpath) 582 except RuntimeError: 583 verbose.report("Could not open font file %s"%fpath) PermissionError: [Errno 13] Permission denied: '/Library/Fonts/WarnockPro-Disp.otf'
I have tried different versions of matplotlib and have deleted the font cache. Nothing seems to solve the problem. Matplotlib is supposed to have patched this problem, but using the matplotlib master still throws the same error. Do you have any ideas on how to resolve?