Attribute error, object has no attribute

1840
2
03-21-2014 01:44 PM
MelissaVan_Scoyoc
New Contributor
So I am very new to python and working through my first online course. Does anyone know how I can fix this error:

>>> arcpy.Clip_analysis("RI_Sewers","Providence","C:/student/PythEveryone10_1/PythonInArcGIS/RhodeIsland.gdb/Sewers2","#")
Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Clip_analysis'
>>>
>>>
I have updated my PYTHONPATH and tried importing arcpy.conversion. Some functions work in arcpy, but not all functions. For example the arcpy.mapping.ListLayoutElements function works fine, but clipping and buffers return the error above. I can run the clip and buffer tools fine.

I also tried running arcpy in Pythonwin and got the following error:
  File "C:\ESRI\Python27\ArcGIS10.1\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\student\PythEveryone10_1\HandleErrors\Debugging.py", line 11, in <module>
    arcpy.Buffer_analysis(streams, streams + str(buff), buff)
AttributeError: 'module' object has no attribute 'Buffer_analysis'


I know the scripts I am running are written correctly because they are straight from the esri online course and they worked on Tuesday, but something has been corrupted since Tuesday and now they don't run.

Thanks
Tags (2)
0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus
did you do this first?

>>> import arcpy
0 Kudos
MelissaVan_Scoyoc
New Contributor
Yes. Though FYI arcpy is preloaded in ARC 10.1 so you don't have to do that anymore.
0 Kudos