<?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: overwriteOuput works in ArcMap's Python Window but not in PythonWin in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641646#M50013</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;instead of &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = "True"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;try a boolean instead of a text string&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;or &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = 1&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Dec 2011 15:58:02 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2011-12-09T15:58:02Z</dc:date>
    <item>
      <title>overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641644#M50011</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;This has to be simple, but it's driving me a bit crazy at the moment. The following code works fine and allows overwriting when using the Python Window in ArcMap v10 sp3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]arcpy.env.workspace = "C:\\Data\\Assessors.gdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = "True"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Buffer_analysis("FireCalls", "FireBuff", "1000 Meters")[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I put this into a script in PythonWin and run it with the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace = "C:\\Data\\Assessors.gdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = "True"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Buffer_analysis("FireCalls", "FireBuff", "1000 Meters")[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get 'Ouput ... already exists' as an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I seem to have a basic problem here and I'm not figuring it out. I can even print the value of arcpy.env.overwriteOutput in the PythonWin program and it comes out as True. It just seems that ArcGIS is not recognizing this. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I doing something wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 12:11:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641644#M50011</guid>
      <dc:creator>BruceKessler</dc:creator>
      <dc:date>2011-12-09T12:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641645#M50012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There could be something wrong with the PythonWin install. Your code works fine when I use a sample geodatabase dataset version in PythonWin. Try running the same script in IDLE and see what you get. Maybe try working with a different output name and see if that makes a difference for doing the overwrite output.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 13:02:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641645#M50012</guid>
      <dc:creator>StephanieWendel</dc:creator>
      <dc:date>2011-12-09T13:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641646#M50013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;instead of &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = "True"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;try a boolean instead of a text string&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;or &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = 1&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 15:58:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641646#M50013</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-12-09T15:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641647#M50014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There could be something wrong with the PythonWin install. Your code works fine when I use a sample geodatabase dataset version in PythonWin. Try running the same script in IDLE and see what you get. Maybe try working with a different output name and see if that makes a difference for doing the overwrite output.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks. That got me to thinking that I should stop/start PythonWin...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DANGIT! It works fine now... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can't imagine how much frustration little things like this cause me... well, I bet you can as you've probably been in a similar situation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 20:05:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641647#M50014</guid>
      <dc:creator>BruceKessler</dc:creator>
      <dc:date>2011-12-09T20:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641648#M50015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;instead of &lt;BR /&gt;arcpy.env.overwriteOutput = "True"&lt;BR /&gt; &lt;BR /&gt;try a boolean instead of a text string&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;arcpy.env.overwriteOutput = 1&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Dan. I actually tried all those permutations to no avail. Look at my above posting for the "duhhhh" solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 20:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641648#M50015</guid>
      <dc:creator>BruceKessler</dc:creator>
      <dc:date>2011-12-09T20:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641649#M50016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are developing and testing scripts, it is often useful to include a &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;reload(arcpy)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;line after the initial import, nothing gets changed once arcpy gets loaded until you quit python or pythonwin, hence, a reload causes arcpy to get reinstantiated removing the need to quit and start again.&amp;nbsp; Once script development is done, then you can comment out the line.&amp;nbsp; This applies to other modules that are imported, including user-developed ones, or numpy etc etc.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 20:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641649#M50016</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-12-09T20:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641650#M50017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Dan.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2011 15:06:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641650#M50017</guid>
      <dc:creator>BruceKessler</dc:creator>
      <dc:date>2011-12-15T15:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641651#M50018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having the same problem as Kessler. When I run the following program from PythonWin it works fine the first time when the output file does not exist, but fails the second time immediately after despite indicating that overwriting is enabled. It likewise fails from IDLE. This happens after rebooting the machine and without at any stage running ArgGIS (which is 10.1). There are no lock files that I can see. I am running XP SP3 in case that has any relevance. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = "d:\Temp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.overwiteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if env.overwiteOutput:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Overwriting is set to True"&amp;nbsp;&amp;nbsp; #This line is indented in the script&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Clip_analysis("parks.shp","zip.shp","parks_clip.shp")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print arcpy.GetMessages()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Overwriting is set to True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "D:\Temp\my_clip.py", line 7, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis("parks.shp","zip.shp","parks_clip.shp")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\analysis.py", line 56, in Clip&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000725: Output Feature Class: Dataset d:\Temp\parks_clip.shp already exists.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Clip).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have repeated the experiment with the exact same results on a different machine (also XP SP3) except this time I ran IDLE before running PythonWin in case PythonWin was somehow corrupting things. (Okay, I know I am grasping at straws, but this is really bugging me).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the script is cut and paste in the Python window in ArcGIS is works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone any ideas? Please.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Apr 2013 10:05:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641651#M50018</guid>
      <dc:creator>DennisPringle</dc:creator>
      <dc:date>2013-04-07T10:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641652#M50019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;spelling&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.overwiteOutput &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;should be&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.overwriteOutput&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Apr 2013 12:57:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641652#M50019</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2013-04-07T12:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: overwriteOuput works in ArcMap's Python Window but not in PythonWin</title>
      <link>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641653#M50020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Dan. You have saved my sanity, although at this stage nothing can save my self esteem! I cannot believe that I not only misspelled it, but misspelled it twice. (I could have sworn I was using the autocomplete, but obviously not).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Apr 2013 21:20:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overwriteouput-works-in-arcmap-s-python-window-but/m-p/641653#M50020</guid>
      <dc:creator>DennisPringle</dc:creator>
      <dc:date>2013-04-07T21:20:06Z</dc:date>
    </item>
  </channel>
</rss>

