#41: installing mapnik in OS X with MacPorts

Mapnik is an open source map rendering lib that makes pretty maps and has an extensive Python API. Unfortunately, it's still a pain in the ass to install with macports. Luckily, there are some really helpful people in the community....

get everything just right...

The directions at http://trac.mapnik.org/wiki/MacInstallation are pretty good, but they're missing some important things:

* you need to use python26, b/c the boost +python25 port is broken
* you should delete ALL pre-existing mapnik files from previous attempts
* do NOT use sudo when configuring, or it may not detect some important ENV vars
* you add some extra build flags to make really, really sure it builds against the macports version of python:

FRAMEWORK_PYTHON = False FULL_LIB_PATH = True PREFIX = '/opt/local/'

So in the end, after installing all the deps with macports as described on the Mapnik wiki, my config and build looked like this:

python scons/scons.py configure \ FULL_LIB_PATH=True \ PREFIX=/opt/local/ \ FRAMEWORK_PYTHON=False \ PNG_LIBS=/opt/local/lib \ PNG_INCLUDES=/opt/local/include \ ICU_INCLUDES=/opt/local/include \ ICU_LIBS=/opt/local/include \ XML2_CONFIG=/opt/local/bin/xml2-config python scons/scons.py sudo python scons/scons.py install

Many, many thanks to Dane Springmeyer for superheroically helping me out with this.

Think you've got a better solution? Help 148c663fd665c53518538e093ce3c2ab_small kueda out by posting your solution