Skip to main content

My PYTHONPATH system variable is set to the following and python.exe and pythonw.exe are both in the D:\\apps\\Python\\ArcGIS10.5 folder. This script works fine in the Python window in ArcMAP.

D:\\apps\\Python\\ArcGIS10.5; D:\\apps\\ArcGIS\\Desktop10.5\\bin

Have you tried explicitly pointing the python interpreter to the arcgis dll?

 

 


Do you have the Python Compatibility workspace parameter set to ESRI ArcGIS Desktop, as shown in the following screenshot?

Also, make sure that your script begins with import arcpy.


Reply