<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error: Cannot get exclusive schema lock in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-cannot-get-exclusive-schema-lock/m-p/283662#M21903</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This looks like you are making a shapefile? You may need to add .shp, though it really shouldn't make a difference. Do you have a previous version with the same name open in another process/application?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, you should be using a list for the fields to delete.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;['COMMENT','YEAR','Join_Count','TARGET_FID','Shape_Le_1','BUFF_DIST']&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, add the raw string tag to your paths to avoid problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Eg. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&lt;STRONG&gt;r&lt;/STRONG&gt;"W:\ENG\Geomatics\GIS\Eastern Region Geodatabase.gdb"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jan 2013 19:45:08 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2013-01-16T19:45:08Z</dc:date>
    <item>
      <title>Error: Cannot get exclusive schema lock</title>
      <link>https://community.esri.com/t5/python-questions/error-cannot-get-exclusive-schema-lock/m-p/283661#M21902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am getting an error 000464: Cannot get exclusive schema lock. Either being edited or in use by another application. Failed to execute deletefield&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

arcpy.env.workspace = "W:\ENG\Geomatics\GIS\Eastern Region Geodatabase.gdb"

arcpy.geoprocessing.env.overwriteOutput = True

arcpy.Buffer_analysis("ER_5_Year_Program", "W:\ENG\Geomatics\GIS\Map &amp;amp; Data Requests\Contracts\Maintenance\Culverts\Data\Culvert Utilities\Program_Buff", "350 METERS", "FULL", "FLAT", "NONE")

targetFeatures = "W:\ENG\Geomatics\GIS\Eastern Region Geodatabase.gdb\ER_Culverts"
joinFeatures = "W:\ENG\Geomatics\GIS\Map &amp;amp; Data Requests\Contracts\Maintenance\Culverts\Data\Culvert Utilities\Program_Buff"
&amp;nbsp; 
outfc = "W:\ENG\Geomatics\GIS\Map &amp;amp; Data Requests\Contracts\Maintenance\Culverts\Data\Culvert Utilities\Culvert_5YCP.shp"
&amp;nbsp; 
fieldmappings = arcpy.FieldMappings()
fieldmappings.addTable("ER_Culverts")
fieldmappings.addTable("W:\ENG\Geomatics\GIS\Map &amp;amp; Data Requests\Contracts\Maintenance\Culverts\Data\Culvert Utilities\Program_Buff.shp")

GWPFieldIndex = fieldmappings.findFieldMapIndex("GWP")
fieldmap = fieldmappings.getFieldMap(GWPFieldIndex)
field = fieldmap.outputField
 
field.name = "WP"
field.length = "100"
fieldmap.outputField = field
 
fieldmap.mergeRule = "Join"
fieldmap.joinDelimiter = ","
fieldmappings.replaceFieldMap(GWPFieldIndex, fieldmap)

arcpy.SpatialJoin_analysis("ER_Culverts", "W:\ENG\Geomatics\GIS\Map &amp;amp; Data Requests\Contracts\Maintenance\Culverts\Data\Culvert Utilities\Program_Buff.shp", outfc,"JOIN_ONE_TO_ONE","KEEP_COMMON", fieldmappings)

arcpy.ResetEnvironments()
arcpy.env.workspace = "W:\ENG\Geomatics\GIS\Map &amp;amp; Data Requests\Contracts\Maintenance\Culverts\Data\Culvert Utilities"

arcpy.Select_analysis("Culvert_5YCP.shp", "Culverts_to_Review", '''"STD_CND" in ('Poor', 'Very Poor', 'Unknown', '')''')

arcpy.DeleteField_management("Culverts_to_Review", "COMMENT;YEAR;Join_Count;TARGET_FID;Shape_Le_1;BUFF_DIST")

arcpy.Delete_management("Culvert_5YCP.shp")

arcpy.Delete_management("Program_Buff.shp")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The culverts to review.shp is in a file on our network drive and not in a gdb, no one else is accessing it but me. Any ideas as to why I would be getting this error?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:17:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-cannot-get-exclusive-schema-lock/m-p/283661#M21902</guid>
      <dc:creator>EmilyAgar1</dc:creator>
      <dc:date>2021-12-12T16:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Cannot get exclusive schema lock</title>
      <link>https://community.esri.com/t5/python-questions/error-cannot-get-exclusive-schema-lock/m-p/283662#M21903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This looks like you are making a shapefile? You may need to add .shp, though it really shouldn't make a difference. Do you have a previous version with the same name open in another process/application?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, you should be using a list for the fields to delete.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;['COMMENT','YEAR','Join_Count','TARGET_FID','Shape_Le_1','BUFF_DIST']&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, add the raw string tag to your paths to avoid problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Eg. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&lt;STRONG&gt;r&lt;/STRONG&gt;"W:\ENG\Geomatics\GIS\Eastern Region Geodatabase.gdb"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 19:45:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-cannot-get-exclusive-schema-lock/m-p/283662#M21903</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-01-16T19:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Cannot get exclusive schema lock</title>
      <link>https://community.esri.com/t5/python-questions/error-cannot-get-exclusive-schema-lock/m-p/283663#M21904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Awesome thank you!! I made both those changes and it runs error free!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One more quick question though, is there a way to bypass the interface that pops up when running a script where you would typically have user inputs? I click on the script in the toolbox then the interface pops up and says there are no input parameters and I have to hit ok on it also then it will run. Its not a big deal but it would be nice if it just runs when you click on the script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 11:51:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-cannot-get-exclusive-schema-lock/m-p/283663#M21904</guid>
      <dc:creator>EmilyAgar1</dc:creator>
      <dc:date>2013-01-17T11:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Cannot get exclusive schema lock</title>
      <link>https://community.esri.com/t5/python-questions/error-cannot-get-exclusive-schema-lock/m-p/283664#M21905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In 10.1 you can create a python add-in that is able to bypass this I believe. In 10.0 I'm not sure if you can without using ArcObjects.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 12:31:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-cannot-get-exclusive-schema-lock/m-p/283664#M21905</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-01-17T12:31:31Z</dc:date>
    </item>
  </channel>
</rss>

