Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Dane Springmeyer edited this page · 43 revisions
Clone this wiki locally


Installing Mapnik on Ubuntu

For all versions of Ubuntu make sure you are up to date before starting to install:

sudo apt-get update
sudo apt-get upgrade

For previous versions see the archived notes at UbuntuInstallationOld

Ubuntu Maverick (10.10)

This release has Mapnik packages for 0.7.1 (to check run apt-cache show libmapnik*), so you can either install Mapnik from packages or source.

Install from packages

sudo apt-get install libmapnik0.7 mapnik-utils python-mapnik

Note: then you will likely also want to install Postgres + PostGIS (see below)

Install Mapnik from source

First, remove any apt installing packages:

sudo apt-get remove libmapnik* mapnik-utils python-mapnik

Set up build environment

# get a build environment going...
sudo apt-get install -y g++ cpp \
libboost-filesystem1.42-dev \
libboost-iostreams1.42-dev libboost-program-options1.42-dev \
libboost-python1.42-dev libboost-regex1.42-dev \
libboost-system1.42-dev libboost-thread1.42-dev \
python-dev libxml2 libxml2-dev \
libfreetype6 libfreetype6-dev \
libjpeg62 libjpeg62-dev \
libltdl7 libltdl-dev \
libpng12-0 libpng12-dev \
libgeotiff-dev libtiff4 libtiff4-dev libtiffxx0c2 \
libcairo2 libcairo2-dev python-cairo python-cairo-dev \
libcairomm-1.0-1 libcairomm-1.0-dev \
ttf-unifont ttf-dejavu ttf-dejavu-core ttf-dejavu-extra \
subversion build-essential python-nose

# install plugin dependencies
sudo apt-get install libgdal1-dev python-gdal \
postgresql-8.4 postgresql-server-dev-8.4 postgresql-contrib-8.4 postgresql-8.4-postgis \

Then compile and install Mapnik

For instructions on compiling trunk (aka Mapnik2) see: wiki:Mapnik2

svn co mapnik-0.7.1
cd mapnik-0.7.1
python scons/ configure INPUT_PLUGINS=all OPTIMIZATION=3 SYSTEM_FONTS=/usr/share/fonts/
python scons/
sudo python scons/ install

Then run:

$ sudo ldconfig

To test mapnik:

$ Python
>>> import mapnik
  • No output is good.

Then run the full test suite

cd mapnik-0.7.1
python tests/

If you are interested what libraries mapnik linked against do (for example):

ldd /usr/lib/python2.6/site-packages/mapnik/ | grep boost
Something went wrong with that request. Please try again.