Casey W. Stark

Astrophysics, computation, and code

Note to Self About Python Graphics

| Comments

On a Mac (and possibly other systems), do not install the 64-bit version of EPD. Only install the 32-bit if you want your graphics to work.

This is a bug that has to do with the Mac framework architecture. Basically, you need to install matplotlib to /Library/Frameworks/Python.framework/ or matplotlib will not be able to interact with the Mac OS X Windows Manager properly. I don’t know the first thing about window managers, but I can tell you that this is really important when you want to save your figures.

I tried many things, including installing numpy, scipy, and matplotlib in a virtualenv. I thought it would be much cleaner to “activate” my scientific environment, keeping the Apple Python build as my system default. I got this all setup and when I tried to use matplotlib, I could not type in the textfield in the matplotlib save figure window. That is, I would plot something, click save, and then I could not enter a filename in the dialogue box. Infuriating.

So I gave up and installed the EPD 32-bit academic version. Not ideal, but it works really well and it just means my environment variables are a tiny bit mangled. No bigs.

Comments