mapnik / mapnik-gyp

GYP build system for Mapnik 3.x
8 stars 7 forks source link

DLL load failed when building mapnik #10

Closed stefda closed 9 years ago

stefda commented 9 years ago

I've managed to install all dependencies but get the following error:

Traceback (most recent call last):
  File "..\tests\visual_tests\test.py", line 5, in <module>
    import mapnik
  File "C:\dev\projects\mapnik-dependencies\packages\mapnik-master\bindings\python\mapnik\__init__.py", line 73, in <module
    from _mapnik import *
ImportError: DLL load failed: The specified module could not be found.
DONE building Mapnik
----------ERROR MAPNIK --------------
!!!!!ERROR: ABORTED!!!!!!
Started at  2:12:17.49, finished at  2:39:02.49
-- DONE ---
Started at  2:12:17.49, finished at  2:39:02.49

Might this be because I'm using VS 15 CTP instead of VS 14?

springmeyer commented 9 years ago

VS 15 Preview should work fine - we are also starting to use it.

The problem appears to be that the Mapnik python bindings are looking for a library that cannot be found. It may be that https://github.com/mapnik/mapnik-gyp/commit/2cdade1792dc6e9d603e59b84369f0212e198a20 is leading to boost_python.dll to be missing.

To know for sure open up C:\dev\projects\mapnik-dependencies\packages\mapnik-master\bindings\python\mapnik\_mapnik.pyd in dependency walker and share the screenshot of what it shows.

stefda commented 9 years ago

Right. There appears to be a few libraries missing, as per the screenshot:

walker

In fact, the dir C:\dev\projects\mapnik-dependencies\packages\mapnik-master\bindings\python\mapnik has no DLLs:

dir

There are also some CPU architecture clashes. I have mapnik 2.2 installed on this machine, could it be that the builder is looking for the DLLs in that version along the PATH?

wilhelmberg commented 9 years ago

@springmeyer you are correct about missing boost_python-vc140-mt-1_57.dll https://github.com/mapnik/mapnik-gyp/commit/2cdade1792dc6e9d603e59b84369f0212e198a20

@stefda could you try a fresh build, I added boost_python-vc140-mt-1_57.dll to the scripts again and verified that it works for me.

stefda commented 9 years ago

It works for me too, thanks @BergWerkGIS! Mapnik now seems to have built but I'm struggling to understand where I should point my PATH and PYTHONPATH to use the new build instead of my old mapnik installation.

When I point my PATH to ...mapnik-gyp\build\lib and ...mapnik-gyp\build\bin and set PYTONPATH as ...mapnik-gyp\build\lib\python2.7\mapnik I get the following error when running a python script:

Traceback (most recent call last):
  File "C:/dev/projects/mapnik-dependencies/packages/mapnik-master/mapnik-    gyp/build/Release/lib/python2.7/mapnik/__init__.py", line 73, in <module>
    from _mapnik import *
ImportError: No module named _mapnik
springmeyer commented 9 years ago

@stefda looks like an odd space showing up in the PYTHONPATH? But overall that is happening because _mapnik.pyd is not found.

wilhelmberg commented 9 years ago

Python bindings are now in their own repository: https://github.com/mapnik/python-mapnik

No Windows support yet as of today.