Python module import error with command prompt of Windows 7
Question: I have a script in Python where i import several modules

    
    
    from __future__ import division
    import os
    import glob
    import sys
    import tempfile
    import shutil
    import math
    import datetime
    import gdal
    import random
    from shapely.geometry import Point
    from shapely.geometry import Polygon
    from shapely.geometry import box
    from liblas import file
    

when i use an IDLE (es: PyCharm or PyScripter) i have no problem to import the
external modules (gdal, shapely.geometry, and liblas). When i run the script i
got this error message

    
    
    C:\PythonScript\myscript.py
    Traceback (most recent call last):
    File "C:\PythonScript\myscript.py", line 10, in <module>
    import gdal
    ImportError: No module named gdal
    where
    
    print(gdal.__file__)
    C:\Python27\lib\site-packages\gdal.pyc
    and
    
    print(sys.path)
    ['C:\\Program Files (x86)\\JetBrains\\PyCharm 2.7.3\\helpers\\pydev', 'C:\\Python27\\lib\\site-packages\\progressbar-2.3-py2.7.egg', 'C:\\windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\PythonScript']
    

i installed gdal using Unofficial Windows Binaries for Python Extension
Packages using an file *.exe.


Answer: Try to check the path of Python install and site-packages. if something wrong
with that, your system might not be able to find the modules and site-packages
which may cause such errors.

