[osgeo4w-dev] Python GIS programming environment under Windows

Gilles Bassière gbassiere at gmail.com
Thu Dec 16 04:21:12 EST 2010


Matt Wilkie wrote:
> On 15/12/2010 3:42 PM, Gilles Bassière wrote:
>> I don't understand why the GDAL Python bindings are not made
>> available on the python path by the gdal-python
> 
> They should be available if you work from within OSGeo4W shell
> (OSGeo4W.bat, which calls bin\o4w_env.bat and etc\ini\*.bat). If you
> don't use the o4w shell then you need to create the environment in some
> other way, as Alex does.
> 

If I understand you, there should be something wrong with my setup
because if I open the OSGeo4W shell (double-click on the Desktop icon
which point to the OSGeo4W.bat file), I can launch the python
interpreter but it will not load osgeo.* modules:
http://pastebin.com/GNtUqy0F

After a little more investigations, this didn't seem to be a bug to me.
It looks more like a design choice. Indeed, I can't find any instruction
to put %OSGEO4W_ROOT%\apps\gdal-17\pymod on the Python path in the
etc\ini\*.bat files. Also, I've seen examples of user explicitly
modifying the Python path:
- http://code.google.com/p/maptiler/source/browse/trunk/setup.py?r=13
- Alex's batch file

That was the sense of my remark. It was not easy to understand that some
Python modules need to be made available explicitly whereas some others
are already on the Python path right after installation. But if this is
a design choice, I'm sure there is a good reason for it and I can live
with it, no problem :)

Best regards
-- 
Gilles Bassière - Web/GIS software engineer
http://gbassiere.free.fr/


More information about the osgeo4w-dev mailing list