I am having an issue with schema locks while working on feature classes within a file geodatabase in ArcMap. There have been similar posts to mine (Avoiding exclusive schema lock error with ArcPy?). However, I am not working in an ArcSDE environment. I am running a Python script through the command line (Conda thru Windows if pertinent):
which calls arcpy functions WHILE ArcMap is open.
arcpy.DeleteField_management(fp_feature, ['field1', 'field2'])
I get this error (in command line console):
File "field_mappings_config.py", line 42, in <module> arcpy.Delete_management(fc) File "C:\Program Files (x86)\ArcGIS\Desktop10.6\arcpy\arcpy\management.py", line 4363, in Delete raise e arcgisscripting.ExecuteError: ERROR 000464: Cannot get exclusive schema lock. Either being edited or in use by another application. Failed to execute (Delete).
My attrocious work-around is basically turn off and turn on again. I CLOSE ArcMap and rerun. Removing the fp_feature in the current map and/or collapsing feature dataset in ArCatalog without shutting off does not remove the Schema Lock.