Select to view content in your preferred language

How can I import gdal in python25?

2044
4
01-22-2011 05:08 AM
zhliang
New Contributor
http://fwtools.maptools.org/
I downloaded the FWTools2.4.7(windows 32bits)with a subpackage of python23,I hope it can be use in python25?what can I do?

>>> import gdal

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import gdal
ImportError: No module named gdal
Tags (2)
0 Kudos
4 Replies
RobinWilson
Emerging Contributor
I'm afraid I haven't got an installation of Python 2.5 to test this on, but whenever I use GDAL I import it as follows:

from osgeo import gdal

This is because the gdal module is located inside the osgeo module.

Let me know if that works,

Robin
0 Kudos
BartłomiejStaroń
Occasional Contributor
it does not work. I get an error.
I tried to show him the path, but without any effect.

maybe some other ideas?
0 Kudos
KimOllivier
Honored Contributor
First you must get the correct version of GDAL for Python 2.5
Then the install notes tell you to add the directory to the search path PATH in Windows.
You cannot add path names using import.
Here is the download page and instructions
http://pypi.python.org/pypi/GDAL/
0 Kudos
BartłomiejStaroń
Occasional Contributor
I installed, but I still can not import gdal module to script...

I use

from osgeo import gdal...
0 Kudos