[gdal-dev] Problems packaging with py2exe

Armin Schmidt Armin.R.Schmidt at Gmail.com
Thu Aug 14 05:44:58 PDT 2014


I am trying to package my GDAL/OGR Python project with py2exe so that
the users don't need to do a separate GDAL installation, but I can't get 
it to work.

As an example, this simple two-line program results in the error message 
below when the final .exe file is called.

import osgeo.gdal as gdal
print __name__

Traceback (most recent call last):
   File "temp.py", line 1, in <module>
   File "osgeo\__init__.pyc", line 21, in <module>
   File "osgeo\__init__.pyc", line 13, in swig_import_helper
   File "osgeo\_gdal.pyc", line 12, in <module>
   File "osgeo\_gdal.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.

I have found several references to the same problem but no definitive
solution. Most comments refer to the correct installation of GDAL - but
the whole point is to distribute everything that is needed from GDAL in
the packaged installation file.

I have used dependency walker to check what _gdal.pyd (or
osgeo._gdal.pyd, which is produced by py2exe) require and have put
missing dll's into the system32 folder, but that didn't help either. I
just can't figure out what
  File "osgeo\_gdal.pyc", line 10, in __load
tries to load.

Armin

-- 
__________________________________________________________________
Dr. Armin Schmidt
Director, GeodataWIZ Ltd:  Geo Data + Visualisation
  www.GeodataWIZ.com
  www.GeodataWIZ.com/armin-schmidt
Chairman, Internat. Society for Archaeological Prospection
  www.archprospection.org
Postdoctoral Researcher, University of Groningen
  Groningen Institute of Archaeology
Honorary Visiting Research Fellow, University of Bradford
  Department of Archaeological Sciences
Honorary Fellow, Durham University, Department of Archaeology
http://orcid.org/0000-0002-4241-5381

Email: Armin.R.Schmidt at Gmail.com

Now available:
Earth Resistance for Archaeologists (2013). Lanham: AltaMira Press
Geophysical Data in Archaeology (2013). Oxford: Oxbow Books.
http://www.amazon.co.uk/-/e/B0034QC4OW
__________________________________________________________________


More information about the gdal-dev mailing list