I have installed python 2.5.1 and FWTools2.4.7 in my laptop(Windows 7) when i run my pythonscript in FWTools i get following error Import error:No module named _gdal can any one suggest how to solve this problem?
Generally speaking FWTools is pretty old and it should be used with care. However, FWTools is very easy to install and therefore I keep FWTools 2.0.6 and a few more versions always with me on USB stick.
FWTools includes its own python and at least those python scripts which are included in the \bin directory of FWTools should work without troubles.
- Open the Windows command window
- Set environment by running
- Test if python is found and which version it is with
python -V. FWTools 2.0.6 has python v. 2.3.4.
- Test with some of the included scripts, for example
You should see some messages from the script.
For some reason you must launch the script as
python script.py or otherwise I get exactly the same error than you:
C:\FWTools2.0.6>gdal2tiles.py Traceback (most recent call last): File "C:\FWTOOL~1.6\bin\gdal2tiles.py", line 38, in <module> import gdal File "c:\FWTOOL~1.6\pymod\gdal.py", line 191, in <module> import _gdal ImportError: No module named _gdal
Please do not use FWTools anymore. It is outdated.
Current GDAL for Windows with python support is available via OSGEO4W (which works with Python 2.7), or from http://www.gisinternals.com/sdk/