python matplotlib framework under macosx?

Neil G picture Neil G · Nov 9, 2010 · Viewed 24.9k times · Source

I am getting this error:

/sw/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py:235: UserWarning: Python is not installed as a framework. The MacOSX backend may not work correctly if Python is not installed as a framework. Please see the Python documentation for more information on installing Python as a framework on Mac OS X

I installed python27 using fink and it's using the default matplotlib is using macosx framework.

Answer

Iron Pillow picture Iron Pillow · Jan 4, 2016

Some users may not want to change the backend for all of their scripts. This page -- http://matplotlib.org/faq/usage_faq.html#what-is-a-backend -- tells another way:

import matplotlib
matplotlib.use('TkAgg')

You have to do this before importing a subpackage of matplotlib or a third-party package that depends on matplotlib.