Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to run this very simple script to check a problem in another more comlpex one.

import arcpy
arcpy.env.workspace= 'C:\\Users\\Umberto\\Desktop\\Prove_Script\\Karakoram\\temporary_01'

rst= arcpy.listRasters ()
print rst

I didn't find out what's the matter so far. In python console within arcgis it works without any problem. It gives me this error:

Traceback (most recent call last):
  File "C:\Python27\ArcGIS10.1\Lib\site-  packages\pythonwin\pywin\framework\", line 326, in RunScript
    exec codeObject in __main__.__dict__
  File     "C:\Users\Umberto\Documents\UniversitᝐhD\Karakoram\MODIS_Pakistan\Script\",     line 4, in <module>
    rst= arcpy.listRasters ()
AttributeError: 'module' object has no attribute 'listRasters'
share|improve this question
up vote 4 down vote accepted

arcpy.ListRasters is capitalised, your code should be:

rst= arcpy.ListRasters ()
share|improve this answer
so simple... Thank You so much, the other time I've been using this function I didn't do such a mistake... – umbe1987 Jan 28 '13 at 13:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.