Arcpy scripting works in Python window but not in Script

01-19-2018 10:23 PM
New Contributor

Codes work in ArcMAP Python window, but error when run as a script

The attached codes work in Arcmap python window when I copied and passed them line by line, but error in line 65 (arcpy.Project_management) and following (when I temporarily delete the Project tool then the error raise in AddField tool ) when I run it as a script. The error information is "

RuntimeError: Object: Error in executing tool


What is wrong with it?

Tags (1)
0 Kudos
1 Reply
MVP Legendary Contributor


Project requires an input featureclass name and an output featureclass name.  'windfarm' is defined as the def to run, the geodatabase and a workspace.  Try a new name like 'windfarm2' but put windfarm2 in quotes, you currently have it as a variable name and arc* is probably getting confused