[SOLVED] 'Freetype library not found' - using macports on OS X 10.8



Hey all, Pebble n00b here…

Was following the OS X install instructions but using macports instead of homebrew since I already had it installed.

Everything seemed to go fine until the last step…
$ python -c "import freetype"
Traceback (most recent call last):
File “”, line 1, in
File “/Users/alexweber/Library/Python/2.7/lib/python/site-packages/freetype/init.py”, line 38, in
raise RuntimeError, 'Freetype library not found’
RuntimeError: Freetype library not found

I’m assuming based on the searching & reading I’ve done that this is a problem with Python not knowing where to find Freetype since I installed it using macports, which has no equivalent to “brew link --force” (AFAIK).

I tried adding some more locations onto my $PATH but that didn’t seem to help. Here’s what I tried (some spaces added for formatting)
$ echo $PATH
/opt/local/lib:/opt/local/include:/Users/alexweber/pebble-dev/arm-cs-tools/bin: /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

I did find that Freetype.6.dylib exists in /opt/local/lib so that’s why I added that to $PATH but alas, no dice.

Here’s the posts I’ve already read and tried to use as references, in case it helps:
Thanks in advance, Pebble Hackers!


And, thanks to my wonderful friends on FB, I seem to have a working solution to this!

Here’s what I did, adapted from the second solution here: http://stackoverflow.com/questions/4092994/unable-to-install-matplotlib-on-mac-os-x

$ sudo ln -s /opt/local/lib/libfreetype.dylib /usr/local/lib/libfreetype.dylib
$ sudo ln -s /opt/local/include/freetype2/freetype /usr/local/include/freetype

Then I ran the old python -c “import freetype” and got no errors! woop woop! Hope this helps someone in the future.


Update, also used this to solve my error with ./waf configure giving “Could not determine the compiler type”.

Basically the same problem. libmpc, libmpfr, and libgmp had to be symlinked. Here’s what I did:
sudo ln -s /opt/local/lib/libmpc.3.dylib /usr/local/lib/libmpc.3.dylib
sudo ln -s /opt/local/lib/libmpfr.4.dylib /usr/local/lib/libmpfr.4.dylib
sudo ln -s /opt/local/lib/libgmp.10.dylib /usr/local/lib/libgmp.10.dylib

And now I’m off and away!