mapbox / windows-builds

DEPRECATED! build scripts for mapnik dependencies, mapnik, node-mapnik, node, libosmiom, osmium-tool
38 stars 22 forks source link

How to install mapnik 3 with python from prebuilt binaries on Windows 7 #114

Closed Nacktiv closed 6 years ago

Nacktiv commented 6 years ago

Since I didn't find any guide, I tried it myself, without knowing whether it will work. It took me more than 1 full day reading repositories, searching binaries, dealing with errors, tracing dll's, jumping through paths. Now I try to condense that down to a few lines. Since I am not a programmer, I understand only partially whats written here. So may be somebody with more insight could check my writings.

Good luck

EDIT 02.Okt.2017 Now after a while this refused to work. It turned out that the redistributable files for Visual Studio 2015 are no longer correct (vcruntime140.dll and 2 others). Virustotal said they are for ARM architecture :-/ So its good to have a quick check whether it works as I described above. I could solve the problem by uninstalling the Redistributable and installing it again ( repairing didn't work ). Dependency Walker is a good research tool. Just to have a clue whats going on: after typing "import mapnik" in python the following happens:

Loaded "_MAPNIK.PYD" at address 0x66790000. Loaded "ICUUC56.DLL" at address 0x4A800000. Loaded "ICUDT56.DLL" at address 0x4AD00000. Loaded "VCRUNTIME140.DLL" at address 0x6D020000. Loaded "API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL" at address 0x6CF60000. Loaded "UCRTBASE.DLL" at address 0x6A9F0000. Loaded "API-MS-WIN-CORE-TIMEZONE-L1-1-0.DLL" at address 0x6CF50000. Loaded "API-MS-WIN-CORE-FILE-L2-1-0.DLL" at address 0x6CF40000. Loaded "API-MS-WIN-CORE-LOCALIZATION-L1-2-0.DLL" at address 0x6CE40000. Loaded "API-MS-WIN-CORE-SYNCH-L1-2-0.DLL" at address 0x6FB80000. Loaded "API-MS-WIN-CORE-PROCESSTHREADS-L1-1-1.DLL" at address 0x6CE30000. Loaded "API-MS-WIN-CORE-FILE-L1-2-0.DLL" at address 0x6CE20000. Loaded "API-MS-WIN-CRT-STRING-L1-1-0.DLL" at address 0x6CE10000. Loaded "API-MS-WIN-CRT-HEAP-L1-1-0.DLL" at address 0x6CE00000. Loaded "API-MS-WIN-CRT-STDIO-L1-1-0.DLL" at address 0x6CDF0000. Loaded "API-MS-WIN-CRT-CONVERT-L1-1-0.DLL" at address 0x6CDE0000. Loaded "API-MS-WIN-CRT-ENVIRONMENT-L1-1-0.DLL" at address 0x6CDD0000. Loaded "API-MS-WIN-CRT-MATH-L1-1-0.DLL" at address 0x6CDC0000. Loaded "API-MS-WIN-CRT-TIME-L1-1-0.DLL" at address 0x6CDB0000. Loaded "BOOST_PYTHON-VC140-MT-1_59.DLL" at address 0x6CD10000. Loaded "MSVCP140.DLL" at address 0x6A850000. Loaded "API-MS-WIN-CRT-LOCALE-L1-1-0.DLL" at address 0x6CDA0000. Loaded "API-MS-WIN-CRT-MULTIBYTE-L1-1-0.DLL" at address 0x6CD90000. Loaded "API-MS-WIN-CRT-FILESYSTEM-L1-1-0.DLL" at address 0x6CD80000. Loaded "API-MS-WIN-CRT-UTILITY-L1-1-0.DLL" at address 0x6CD70000. Loaded "MAPNIK.DLL" at address 0x65AA0000. Loaded "LIBWEBP.DLL" at address 0x6A7F0000. Loaded "ICUIN56.DLL" at address 0x023C0000. Loaded "LIBPNG16.DLL" at address 0x6A7B0000. Loaded "LIBTIFF.DLL" at address 0x6A720000. Loaded "JPEG62.DLL" at address 0x6A6C0000. Loaded "CAIRO.DLL" at address 0x6A150000. Loaded "_HASHLIB.PYD" at address 0x6A050000. Loaded "CRYPTSP.DLL" at address 0x73620000. Loaded "RSAENH.DLL" at address 0x735E0000. Loaded "CSV.INPUT" at address 0x69C20000. Loaded "GDAL.INPUT" at address 0x6A680000. Loaded "GDAL200.DLL" at address 0x64AE0000. Loaded "LIBEXPAT.DLL" at address 0x69BB0000. Loaded "ODBC32.DLL" at address 0x701F0000. Loaded "WS2_32.DLL" at address 0x774B0000. Loaded "NSI.DLL" at address 0x76240000. Loaded "ODBCINT.DLL" at address 0x70D50000. Loaded "GEOJSON.INPUT" at address 0x69AF0000. Loaded "OGR.INPUT" at address 0x6A630000. Loaded "PGRASTER.INPUT" at address 0x69A90000. Loaded "WSOCK32.DLL" at address 0x6DC00000. Loaded "SHFOLDER.DLL" at address 0x6E210000. Loaded "SECUR32.DLL" at address 0x72C50000. Loaded "POSTGIS.INPUT" at address 0x68CA0000. Loaded "RASTER.INPUT" at address 0x6CCE0000. Loaded "SHAPE.INPUT" at address 0x69A50000. Loaded "SQLITE.INPUT" at address 0x649E0000. Loaded "TOPOJSON.INPUT" at address 0x68C10000.

akreider commented 6 years ago

I tried this. But when I do "import mapnik" I get errors: c:\mapnik-sdk\python\2.7\site-packages\mapnik__init__.py::74 RunTimeWarning: to-Python converter for class std::shared_ptr<struct mapnik::geometry::geometry > already registered; second conversion method ignored. from . _mapnik import *

I get the same error five times.

I solved this problem by running "del mapnik" before "import mapnik" to remove the 2.2 version.

The demo works!

am2222 commented 6 years ago

@Wolfgang16 doesnt it work with python 3.6?

wilhelmberg commented 6 years ago

Python@3.x was never supported by mapnik on Windows.

Sorry to let you know but Windows support for mapnik has been dropped: https://github.com/mapbox/windows-builds#deprecated