Installing Mapnik 2.2.0 in windows 7 with Python 2.7

落花浮王杯 提交于 2019-12-23 10:42:19

问题


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

回答1:


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




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/19872040/installing-mapnik-2-2-0-in-windows-7-with-python-2-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!