<?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: arcpy.env.overwriteOutput = True fails in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-env-overwriteoutput-true-fails/m-p/411114#M32411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yep, the lock was the problem. Thanks for the help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tycho&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 May 2014 22:43:14 GMT</pubDate>
    <dc:creator>TychoGranville</dc:creator>
    <dc:date>2014-05-22T22:43:14Z</dc:date>
    <item>
      <title>arcpy.env.overwriteOutput = True fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-env-overwriteoutput-true-fails/m-p/411112#M32409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Probably a newbie question...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I created a table-to-table routine in Model Builder which works as it should. The output table goes to a GeoDB, overwriting any same named table that is already there. I exported the model to Python and now I get the error 000258: Already Exists. I added&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to the script and it still fails. I tried adding the command&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if os.path.exists&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but it also fails (presumably since the table is inside the GeoDB?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What did I miss?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tycho&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 18:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-env-overwriteoutput-true-fails/m-p/411112#M32409</guid>
      <dc:creator>TychoGranville</dc:creator>
      <dc:date>2014-05-22T18:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.env.overwriteOutput = True fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-env-overwriteoutput-true-fails/m-p/411113#M32410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're probably running into a file locking issue. That is, the table you are trying to replace is already locked by another process (probably a table view in memory), so you cannot delete it.&amp;nbsp; That app that has the lock may be your ArcMap session, another application (say ArcCatalog or Excel), or if you are using 10.1SP1 or later and ran background GP, the background GP session.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you close ArcMap (and any other apps that may have the table open), and restart ArcMap, the lock should be released. If you are running your Python script from IDLE, that's another process so you will need to close Arcmap to release the lock so you can delete the output table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Generally Python code exported to ModelBuilder is not very solid and requires some editing. But I think&amp;nbsp; your issue is about the table being open in ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;Probably a newbie question...&lt;BR /&gt;&lt;BR /&gt;I created a table-to-table routine in Model Builder which works as it should. The output table goes to a GeoDB, overwriting any same named table that is already there. I exported the model to Python and now I get the error 000258: Already Exists. I added&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;&lt;BR /&gt;to the script and it still fails. I tried adding the command&lt;BR /&gt;if os.path.exists&lt;BR /&gt;&lt;BR /&gt;but it also fails (presumably since the table is inside the GeoDB?)&lt;BR /&gt;&lt;BR /&gt;What did I miss?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Tycho&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 19:16:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-env-overwriteoutput-true-fails/m-p/411113#M32410</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-05-22T19:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.env.overwriteOutput = True fails</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-env-overwriteoutput-true-fails/m-p/411114#M32411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yep, the lock was the problem. Thanks for the help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tycho&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 22:43:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-env-overwriteoutput-true-fails/m-p/411114#M32411</guid>
      <dc:creator>TychoGranville</dc:creator>
      <dc:date>2014-05-22T22:43:14Z</dc:date>
    </item>
  </channel>
</rss>

