AnsweredAssumed Answered

Python: No module named arcpy 2020

Question asked by ValerieVC_nga on May 8, 2020
Latest reply on May 9, 2020 by Davepike101@hotmail.com

I am taking the Python for Everyone course, at Step 4, Run a script in Python and am getting the following error:

ImportError: No module named arcpy

 

I did see that students had this issue back in 2015. Not sure if the move to ArcGIS Pro is the issue here as I don't even have that open and am working in PyCharm (downloaded this morning). 

 

Script and error message:

#import modules
import sys
import os
print (sys.executable)
print(sys.prefix)
print("PYTHONPATH: " + os.environ["PYTHONPATH"])
print("sys.path:")
print("\n".join(sys.path))
import arcpy

#set workspace
arcpy.env.workspace = r"C:\EsriTraining\Python\PythEveryone\RunningScripts\Polk_County\OregonPolk.gdb"

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

print ("Script completed")

 

ERROR MESSAGE:

Traceback (most recent call last):
  File "C:/EsriTraining/Python/PythEveryone/RunningScripts/Polk_County/SpatialRef.py", line 9, in <module>
    import arcpy
ImportError: No module named arcpy

Outcomes