Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Mapnik 2.2.0 in windows 7 with Python 2.7

I've been trying to install mapnik on my computer for hours but what i always get when I import mapnik is ImportError: DLL load failed: The specified procedure could not be found.

I'm using Windows 7. The currently installed software is Geoserver from Opengeo suite.

Here is my path

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\Java\jre7\bin;C:\Program Files\Java\jdk1.7.0_45\bin;C:\Python27;C:\mapnik-v2.2.0\lib

My python path:

C:\Python27;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\Program Files\ArcGIS\bin;C:\\mapnik-v2.2.0\python\2.7\site-packages\;C:\mapnik-v2.2.0\bin\;
like image 347
Joan Natalie Avatar asked Oct 20 '22 21:10

Joan Natalie


2 Answers

Follow the install instructions

First ensure you have 32 bit python 27 installed.

You can do this by typing the following into a python shell

>>> import platform
>>> platform.architecture()
('32bit', 'WindowsPE')

If you see '64bit', try reinstalling python with the 32bit version (look for the "Python 2.7.5 Windows Installer" link).

After that,

  • Download the mapnik package (I tested it with the full SDK version)
  • Extract the archive to C:\mapnik-v2.2.0
  • Add C:\mapnik-v2.2.0\lib; and C:\mapnik-v2.2.0\bin; to your PATH
  • Add C:\mapnik-v2.2.0\python\2.7\site-packages; to your PYTHONPATH

import mapnik

like image 169
bnjmn Avatar answered Oct 23 '22 11:10

bnjmn


I had the same issue on WinServewr 2008 R2. The solution I found is to install Microsoft Visual C++(x86) redistributable package 10.0.40219, because mapnik depends on it. This package comes with postgreSQL 9.3 x86, so when you install only Postgre x64 version you can have this error.

like image 43
Artem Zh. Avatar answered Oct 23 '22 09:10

Artem Zh.