Install Mapnik on Ubuntu 9.04 Jaunty Jackalope

square peg, round hole ccbysa sfllaw from flicker
This is an addition to Build your own OpenStreetMap Server. The original article addresses the general case of installing on Ubuntu.

My mapnik installation broke during or after I upgraded to Ubuntu Jaunty (9.04).

If you see the following error ...

ImportError: No module named mapnik 

... these instructions may resolve the problem.

Others have reported this error, and there are several suggested fixes around the web. This specific case was not.

In my case mapnik was binding to Python 2.5, where the rest of my system was using Python 2.6. When running ~mapnik/z0_generate_tiles.py, for example, it would invoke Python 2.6, but Python could not find mapnik. How come? scons is supposed to Just Work.

In my case, ~/mapnik/config.py was set to use Python 2.5 only.

Check ~/src/mapnik/config.py

If a line refers to python 2.5, remove it.

Re-run the configure, and scons should find the right Python and Just Work. Then complete the build and install steps as before.

Good luck.

Shoutout!

Thanks again to the awesome springmeyer for all the guidance and patient remote troubleshooting.
Thanks sfllaw on Flickr for licensing your Square peg and round hole photo, above as CC_BY-SA.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <q> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <h1> <h2> <h3> <h4> <pre> <sup> <sub> <blockquote>
  • Lines and paragraphs break automatically.

More information about formatting options