Python is not installed as a framework
johnscancella opened this issue · comments
John Scancella commented
When trying to create the .png file I get the following:
(env)[jscancella@johns-air git-of-theseus (master)]$ python stack_plot.py cohorts.json
/Users/jscancella/work/git-of-theseus/env/lib/python2.7/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.')
Traceback (most recent call last):
File "stack_plot.py", line 1, in <module>
import sys, seaborn, dateutil.parser, numpy, json
File "/Users/jscancella/work/git-of-theseus/env/lib/python2.7/site-packages/seaborn/__init__.py", line 6, in <module>
from .rcmod import *
File "/Users/jscancella/work/git-of-theseus/env/lib/python2.7/site-packages/seaborn/rcmod.py", line 8, in <module>
from . import palettes, _orig_rc_params
File "/Users/jscancella/work/git-of-theseus/env/lib/python2.7/site-packages/seaborn/palettes.py", line 12, in <module>
from .utils import desaturate, set_hls_values, get_color_cycle
File "/Users/jscancella/work/git-of-theseus/env/lib/python2.7/site-packages/seaborn/utils.py", line 12, in <module>
import matplotlib.pyplot as plt
File "/Users/jscancella/work/git-of-theseus/env/lib/python2.7/site-packages/matplotlib/pyplot.py", line 114, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Users/jscancella/work/git-of-theseus/env/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/Users/jscancella/work/git-of-theseus/env/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 24, in <module>
from matplotlib.backends import _macosx
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are Working with Matplotlib in a virtual enviroment see 'Working with Matplotlib in Virtual environments' in the Matplotlib FAQ
Don Morrison commented
@johnscancella looks like you're trying to use a virtualenv like I did. I followed the Matplotlib instructions for a PYTHONHOME
script and it worked like a charm.
Eliel Hojman commented
I think this solution might be simpler.