[gdal-dev] How to get a working version of gdal_retile.py?

Paul Meems bontepaarden at gmail.com
Thu Sep 6 00:18:57 PDT 2012


Thanks Even for all your help.
But I'm still having trouble.

I've made sure all possible Python installs are removed. Deleted all Python
folders, OSGeo4W folders, uninstalled QGIS.
Next I downloaded and installed python-2.7.3.amd64.msi to E:\Python27
Next gdal-19-1600-core.msi. Full install, couldn't set location
Next gdal-19-1600-ecw.msi
Next GDAL-1.9.1.win32-py2.7.msi. This time I got a red cross in the
components panel. I selected 'Install on HD' and put on the bottom
E:\Python27 as the location.

I did a quick test with gdalinfo using the GDAL Command prompt in my Start
menu and that worked. So I assume GDAL is installed correctly.
Next I call gdal_retile.py on this Command prompt and I get this error:
Traceback (most recent call last):
  File "C:\Program Files (x86)\GDAL\gdal_retile.py", line 38, in <module>
    import gdal
  File "E:\Python27\lib\site-packages\gdal.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn
  File "E:\Python27\lib\site-packages\osgeo\__init__.py", line 21, in
<module>
    _gdal = swig_import_helper()
  File "E:\Python27\lib\site-packages\osgeo\__init__.py", line 17, in
swig_impor
t_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: DLL load failed: %1 is not a valid Win32-application.

So it seems Python is still not correctly installed for GDAL.
I do see C:\Program Files (x86)\GDAL; in my PATH, but not Python. Should I
add it?

I think the problem is with the location of GDAL-1.9.1.win32-py2.7.msi. How
should I install this properly? Leave the default setting and don't install
it?
Change the location the my Python27 folder or to my GDAL folder?

Thanks,

Paul

2012/9/5 Even Rouault <even.rouault at mines-paris.org>

> Le mercredi 05 septembre 2012 11:44:50, Paul Meems a écrit :
> > Hi Even,
> >
> > I need to convert the ECW file to GeoTiff because of license issues. It
> is
> > extremely expensive to host ECW files on GeoServer.
> > The converted GeoTiff is 100GB. GeoServer can only handle files up to 2GB
> > so I need to create smaller tiles.
>
> Understood
>
> > That is what the python script will do for me. I'm hoping I can create
> > GeoTiff tiles using the ECW directly without converting it to a large
> > GeoTiff first.
> >
> > I tried the files from http://www.gisinternals.com/sdk/ but that didn't
> > help. I think my problem is more with Python.
> >
> > After updating FWTools with the files from gisinternals I get this error:
> > Traceback (most recent call last):
> >   File "E:\PROGRA~1\FWTOOL~1.7\bin\gdal_retile.py", line 38, in <module>
> >     import gdal
> >   File "e:\PROGRA~1\FWTOOL~1.7\pymod\gdal.py", line 191, in <module>
> >     import _gdal
> > ImportError: No module named _gdal
>
> Did you use the .bat that defines all the environment needed for FWTools ?
> Looks indeed as if Python doesn't know where to find the GDAL Python
> bindings.
>
> But try using directly the deliveries of http://www.gisinternals.com/sdk/and
> do not mix them with FWTools. The builds at gisinternals come with GDAL
> Python
> bindings too. You will need to install the Python version that matches the
> python version of the GDAL python bindings you installed.
>
> For your needs, assuming you've installed Python 2.7, you would need :
>
> http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-gdal-1-9-
> mapserver-6-0\gdal-19-1600-core.msi<http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-gdal-1-9-%0Amapserver-6-0%5Cgdal-19-1600-core.msi>
> http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-gdal-1-9-
> mapserver-6-0\gdal-19-1600-ecw.msi<http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-gdal-1-9-%0Amapserver-6-0%5Cgdal-19-1600-ecw.msi>
> http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-gdal-1-9-
> mapserver-6-0\GDAL-1.9.1.win32-py2.7.msi<http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-gdal-1-9-%0Amapserver-6-0%5CGDAL-1.9.1.win32-py2.7.msi>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120906/121a89bb/attachment.html>


More information about the gdal-dev mailing list