简体   繁体   中英

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\;

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM