Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python matplotlib framework under macosx?

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.

like image 744
Neil G Avatar asked Nov 09 '10 03:11

Neil G


People also ask

Which version of Python is suitable for matplotlib?

Dependencies. Matplotlib requires the following dependencies: Python (>= 3.6) NumPy (>= 1.15)


2 Answers

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.

like image 60
Iron Pillow Avatar answered Sep 23 '22 05:09

Iron Pillow


Optionally you could use the Agg backend which requires no extra installation of anything. Just put backend : Agg into ~/.matplotlib/matplotlibrc

like image 36
Jonathan Avatar answered Sep 24 '22 05:09

Jonathan