[FWTools] Using GDAL in Python IDE
Mark Amend
Mark.Amend at noaa.gov
Thu Sep 28 14:38:02 EDT 2006
Norman-
I too want to be able to do this (using Python 2.4.3 (PythonWin IDE) with several non-FW modules seperately from FWTools1.0.6). I'd like to be able to use the gdal module in a Python script that also taps into ESRI's geoprocessor.
I tried following your guidance by adding the system variables GDAL_DATA, GDAL_DRIVER, and GEOTIFF_CSV using the Environment Variable form in WinXP but no luck in response to "import gdal".
I then tried adding C:\Program Files\FWTools1.0.6\pymod to the Python Path in PythonWin. Browsing the path shows gdal as a module but typing 'import gdal' still gives that "No module named gdal" error Nagendra mentions.
Actually, launching FWTools command line prompt, typing 'python' and then "import gdal" has the same problem. So.. I am at a loss. Any more tips?
Thanks,
Mark Amend
> Nagendra,
>
> To use FWTools the way you describe you will have to copy the FWTools
> environment variables from setfwenv.bat (FWTOOLS_HOME\bin) to your
> system variables (with the exception of adding fwtools python to your
> path), since you are using a different distribution of Python. (I use
> FWTools 1.0.5 which uses has python 2.3.5)
>
> It is also possible to set the environment variables in a script (such
> as setfwenv.bat without the python path variable) and set the
> environment variable PYTHONSTARTUP to point to this file.
>
> Alternatively start the FWTools shell, type python and you are away :-)
>
> Norman
> -----Original Message-----
> From: fwtools-bounces at lists.maptools.org
> [mailto:fwtools-bounces at lists.maptools.org] On Behalf Of Nagendra Singh
> Sent: Wednesday, September 13, 2006 1:51 PM
> To: fwtools at lists.maptools.org
> Subject: [FWTools] Using GDAL in Python IDE
>
> Hi,
>
> I am just starting to learn Python and I want to perform some GIS
> tasks which requires the gdal module (http://www.gdal.org/). I have
> installed FWTools. I am trying to use the gdal module but I keep
> getting an error message that
> gdal module is not found,even after appending the module using the
> sys.path.append command. Can you anyone please let me know how do I
> use the gdal module in the python I have (I dowlloaded it from
> activestate) .
>
> thanks in advance
> Nagendra
More information about the FWTools
mailing list