I install FWTools in Windows7 and run FWTools Shell,after type gdal2tiles,but give error 'no module named osgeo' . 
also i installed OSGEO4W ,but another error to happen
I install FWTools in Windows7 and run FWTools Shell,after type gdal2tiles,but give error 'no module named osgeo' . 
also i installed OSGEO4W ,but another error to happen
It's simply because FWTools is so old that it does not use osgeo Python namespace as illustrated at the bottom of the GDAL Python section about import
You should install GDAL via OSGEO4W or GIS internal instead of using the outdated FWTools
python, then in the command import osgeo? You need to install gdal python executables with the OSGEOW4 and also need to run the command not via the classic DOS command but through the "OSGEO4W Shell"
– ThomasG77
Jan 13 '16 at 07:48