Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

138 lines (85 sloc) 2.977 kB

Mapnik Python Bindings

Official Mapnik python bindings.

https://secure.travis-ci.org/mapnik/mapnik.png

Installation

Prerequisites

Before installing, you need:

  • the mapnik-config utility in your $PATH
  • Boost.Python linked to your python interpreter (see Boost notes)
  • cairo / cairomm (optionnal but enabled if you compiled mapnik with cairo support)
  • mapnik
  • The current python interpreter

Version notes

The python bindings are tied to the mapnik library version.

Mapnik library version Python package
2.0.x mapnik2 (==2.0.1.3)
2.1.0 mapnik (==2.1.0)

You can find your installed version with:

$ mapnik-config -v

Boost notes

To specify which boost_python lib to link against, you can use:

$ export MAPNIK2_BOOST_PYTHON="libboost_python.so.1"

Where you have on your filesystem

/usr/lib/libboost_python.so.1

Don't forget that you can play with LDFLAGS/CFLAGS/LD_LIBRARY_PATH to indicate non standart locations for the requirements if it applies.

Standard installation

You can use either easy_install or pip. Choose the one you prefer into:

$ easy_install mapnik         # to use the last known version
$ easy_install mapnik==2.1.0  # to pin the version
$ pip install mapnik          # to use the last known version
$ pip install mapnik==2.1.0   # to pin the version

Standard installation works with virtualenv too.

If an error occurs, please read carefully Prerequisites, Version notes and Boost notes sections before submitting an issue to the Mapnik tracker.

Buildout

Some developers use buildout to ease deployments.

  • Add mapnik to the list of eggs to install, e.g.
[buildout]
parts = somepart

[somepart]
recipe = minitage.recipe.scripts
...
# (options like include dirs)
...
eggs =
    ...
    mapnik
  • Re-run buildout, e.g. with:
$ ./bin/buildout

Credits

Companies

makinacom

Authors

Contributors

Jump to Line
Something went wrong with that request. Please try again.