[GIS] No module named ‘osgeo’

gdalosgeoosgeo4wpyqt4python

I have installed GDAL and checked on the command line, it is working and when I run the gdal2tiles.py on the command line it works but when I run the same file gdal2tiles.py with python IDLE, I get "No module named 'osgeo'" error. Can you assist.

Best Answer

This sounds like you have multiple python installations, and GDAL is installed on one and not the other.

Try the following (which I have based upon this). Create a text file within your python installation site packages folder C:\Python27\Lib\site-packages called usrlocal.pth. In this text file insert one line giving the path to your second python installation site packages folder which features the GDAL install, for example:

C:\OSGeo4W\apps\Python27\Lib\site-packages