5

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\;
templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
Joan Natalie
  • 330
  • 4
  • 14
  • no luck either, someone know? – Gamma Nov 09 '13 at 11:37
  • Hey @Joan, did you ever get this to work? I just checked again and following [these instructions](https://gist.github.com/springmeyer/5651701) I was able to run both the `c++` and `python` demos as well as `import mapnik` in a running python interpreter. I used the full SDK version, copied to install dir, set all the paths required, and it worked without issue. – bnjmn Nov 12 '13 at 16:56
  • well i did, it seems that my system lacks libxml2.dll so i copied it from mapnik folder into C:/Windows and voila it worked. – Joan Natalie Nov 13 '13 at 07:22

3 Answers3

2

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

bnjmn
  • 4,508
  • 4
  • 37
  • 52
  • 1
    in python shell i see this Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (intel)] on win 32. after i run platform.architecture() and it shows ('32bit', 'WindowsPE') i try to run import mapnik but it's still says Traceback (most recent call last): File "", line 1, in File "C:\mapnik-v2.2.0\python\2.7\site-packages\mapnik\__init__.py", line 69, in from _mapnik import * ImportError: DLL load failed: The specified procedure could not be found.failed: The specified procedure could not be found. – Joan Natalie Nov 09 '13 at 11:19
  • Did you download the 'runtime package' or 'Full SDK' version? – bnjmn Nov 09 '13 at 14:13
  • You need both `c:\\mapnik-v2.2.0\lib;` and `c:\\mapnik-v2.2.0\bin;` on your system path. I don't see them both there. – bnjmn Nov 09 '13 at 14:21
  • 1
    my system path contain C:\mapnik-v2.2.0\lib, but why are you using \\ instead of \? i download the runtime package, i have included the path you said but still no luck – Joan Natalie Nov 09 '13 at 16:39
1

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.

Artem Zh.
  • 438
  • 5
  • 11
0

I had this problem as well, even after I installed a 32-bit Python. I was getting the same error:

ImportError: DLL load failed: The specified procedure could not be found.

What fixed it in the end was copying all the DLLs to my python executable directory. I assume there was some DLL-hell type action going on and it was linking to a DLL somewhere with the same name but without that entrypoint. What entrypoint it was looking for I do not know.

In the end it was all useless though because it turns out that there is no OSM (OpenStreetMaps) plugin for the 2.2.0 version, so I decided to do this on Linux instead.

See the table at https://github.com/mapnik/mapnik/wiki/WindowsInstallation for the reference of a missing OSM plugin - execution results in a runtime error indicating the plugin could not be loaded.

I think Windows binary support for mapnik has been dropped so I don't expect much change here.

Mike Wise
  • 22,131
  • 8
  • 81
  • 104