I've hit a wall trying to trouble shoot my script issue. I am trying to project data from a versioned geodatabase to a local geodatabase. My script has been working fine for months but all of the sudden i keep getting a schema lock error on the same dataset, the problem is, i can't find a lock in database Administration. So I'm performing the following code to investigate:
print(arcpy.TestSchemaLock(dataset))
arcpy.Project_management(dataset, "dataset_reprojected", PROJECTION)
TestSchemaLock comes back as True, ie: should be open. But the Project function continues to come back with ERROR 000464 identifying a schema lock.
python interpreter coming from Pro version 3.3.2
what is 'dataset' ?
Solved: Schema lock error from script tool before script e... - Esri Community
but it may or may not be the issue given what is required for the TestSchemeLock and what you are providing to it.
dataset is a point featureclass
Pop open the file geodatabase folder in explorer, find every .lock file and delete them. Any active locks will trigger the usual Windows error, from there you can use a tool like the File Locksmith in Windows PowerTools to figure out what's holding the lock and then stop that program to safely release it.