arcpy will not import into pythonwin

302
1
09-26-2012 06:54 AM
jasonlewis2
New Contributor
When i enter the import arcpy command in pythonwin I get this error:

Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
ImportError: No module named arcpy

Can anyone tell me how to fix this issue? Thanks.
Tags (2)
0 Kudos
1 Reply
JakeSkinner
Esri Esteemed Contributor
Hi Jason,

Python looks in the directories that are part of the module search path. These directories
are listed in the sys.path variable from the sys module.  To list where  the Python looks for modules, print out the value of the sys.path  variable. For example, type the following in pythonwin's interactive window:

import sys
print sys.path


By default, arcpy's default location is:

C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy

or

C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy

If the path isn't there, try adding the path using the sys.path.append method.  Ex:

 sys.path.append(r"C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy")
0 Kudos