Monday, October 15, 2012

Building Reportlab and Matplotlib on OS X

Reportlab 2.6 is out, and I recently upgraded. I've had a previous post on building Reportlab on OS X with Freetype support, but when I upgraded, the trick I mentioned didn't work. I'm not sure why it ever worked, but I think it did once. Or maybe that was with PIL.

I decided to look for another way to get the job done without editing setup.py, since that didn't work for Matplotlib.

If you have Homebrew installed, you can install Freetype using brew install freetype. Homebrew should warn you about the formula being keg-only and that Mac OS X already provides Freetype in versions before Mountain Lion. You will need to then execute brew link freetype. Any subsequent attempts to install Reportlab or Matplotlib will take advantage of the symlinked copy of Freetype and install properly (well, almost. I had to symlink libpng as well for Matplotlib to install into my virtualenv. Don't know if anyone else would have the same problem, but just in case).

No comments: