Select to view content in your preferred language

Python error 'No module named arcpy'

7301
11
Jump to solution
12-29-2015 10:05 AM
by Anonymous User
Not applicable

Hey folks,

New to python but not coding; I'm running the Python tutorial, Python for everyone, and outright have an error I can't seem to find a solution to. Using Python 2.7.10 I tried running the sample script and immediately got the 'No module named arcpy' error.

My path variables appear correct:

PYTHONPATH: C:\Python27\ArcGIS10.3\Lib\site-packages

My Desktop 10.x pth file:

C:\Program Files (x86)\ArcGIS\Desktop10.3\bin
C:\Program Files (x86)\ArcGIS\Desktop10.3\arcPy
C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcToolBox\Scripts

I'm running Win 0S 7 Pro SP1 64-bit

The example script:

import arcpy  # script fails here
#set workspace
arcpy.env.workspace = r"C:\Student\PythEveryone10_1\RunningScripts\Oregon_Polk.gdb"

#set up a describe object for each fc in gdb
fcList = arcpy.ListFeatureClasses()
for fc in fcList:
    desc = arcpy.Describe(fc)
    print desc.spatialReference.name

print "Script completed"   

Looking for any suggestions for troubleshooting. Thanks!

(Curtis Price​ added formatting and put the import arcpy that is failing at the top)

0 Kudos
11 Replies
by Anonymous User
Not applicable

Thanks all; coincidentally, Dan as you had sent me the info regarding ensuring Pythonwin was within the correct folder path it turns out I had a separate install of Python on this machine and was reading that path for installation for Pythonwin install. I ended up uninstalling everything and reinstalling and ensuring my paths and environments were correct.

Happy to say I'm now in code heaven. Although I was a bit confused at first why ESRI didn't include Pythonwin with the ArcMap installation. But further reading shows their thought process on this.

So thanks again all. I'm sure I'll have more Python related questions as I delve more.

RebeccaStrauch__GISP
MVP Emeritus

Anthony, don't forget to close out this thread by marking all those answers that were helpful, and marking the best solution (if one) as the answer.  This will help others in the future to find the solution.

0 Kudos