Python: No module named arcpy 2020

05-08-2020 11:32 AM
New Contributor

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("PYTHONPATH: " + os.environ["PYTHONPATH"])
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 (

print ("Script completed")


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

Tags (1)
0 Kudos
2 Replies
MVP Frequent Contributor

Your IDE is probably tied to a different library. It can become a bit of a nightmare.

I'd suggest either running the code in an ArcGIS Pro or arcmap python window, or right-clicking on your .py file and selecting 'Open with IDLE ArcGIS Pro' or similar.

0 Kudos
New Contributor

Are we right-clicking on In PyCharm or within a file explorer window? Either way, I don't have the option to Open with IDLE ArcGIS Pro. 

0 Kudos