Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Beginner having trouble importing arcpy

$
0
0
Hey everybody, I am looking at python for my first time ever, trying to follow a tutorial to create a shapefile for each unique value in my attribute table for a specific field. The tutorial suggests I write that start of my code like this:


import arcpy

shpfile = "D:\\GIS\\Python_Exparament\\TEST_YEARS.shp"

cursor = arcpy.SearchCursor(shpfile)

for row in cursor:
print row.YEAR



After I write that section I get an error message saying:

Traceback (most recent call last):
File "D:/GIS/Python_Exparament/py_script.py", line 1, in <module>
import arcpy, OS
ImportError: No module named arcpy


Does anybody have any idea why such a message is coming up?

Thanks for your time.

Viewing all articles
Browse latest Browse all 2485

Trending Articles