I'm having issues with ArcGIS Pro crashing when I run this ArcPy code directly into ArcGIS Pro Python window. I previously wrote the three lines separately but I decided to try to copy python code from Geoproccessing history. However the outcome is the same where ArcGIS Pro Crashes. Specifically, the trailing dots freeze, and the program freezes and the below image pops-up. There is no error code thrown, just a Windows Program 'has stopped working' as seen below
Does it have something to do with how I'm storing or not storing the data?
The code is supposed to select some attributes, copy it to a new layer, and dissolve that new layer. They seem to work individually when run.
import arcpy
arcpy.env.workspace = 'c:\data\python.gdb'
arcpy.management.SelectLayerByAttribute("SHAPE_START", "NEW_SELECTION", "LEASE_NAME LIKE 'ABC%'", None)
arcpy.management.CopyFeatures("SHAPE_START", r"C:\Data\GIS\Project\Python\Python.gdb\INPUT_SHAPE_SELECTION", None, None, None, None)
arcpy.management.Dissolve("INPUT_SHAPE_SELECTION", r"C:\Data\GIS\Project\Python\Python.gdb\FINAL_OUTPUT", None, None, "MULTI_PART", "DISSOLVE_LINES")
I am using ArcGIS Pro 2.2.4 on Windows 10 using the ArcGIS Pro Python Window
arcpy.env.workspace = 'c:\data\python.gdb'
will not be interpreted as you expect, it should bearcpy.env.workspace = r'c:\data\python.gdb'
-defining your path as raw string literal. Also, I suggest you to look at result object.