<?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: Problem when I try to overwrite with Python in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418644#M1441</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Apparently the parameters are not valid in the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.gp.DetectarDiferenciasA(Incidencia_2012, IncidenciaSDE_A)
&lt;/PRE&gt;&lt;SPAN&gt;So, what parameters does that tool require, and are you sure they match with "Incidencia_2012" and "IncidenciaSDE_A"?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:56:23 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2021-12-11T18:56:23Z</dc:date>
    <item>
      <title>Problem when I try to overwrite with Python</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418638#M1435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: diegollamas&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I create a geoprocessing model that basically compare two features class and if it find a new record it write it to a feature class. we export this model to python script so this process could run every day at 6 pm automatically. when we run this model in model builder it works just find but when we run it after export it i got an error saying that some layers already exist but thats why we are overwriting the information. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is the script and we added two lines to force it to overwrite&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19544[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19545[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19546[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and when we run this process from Python this is the error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;IDLE 2.6.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ==== No Subprocess ====&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "C:\CrimeMapping\Replicacion\POLICIA\SyncComandanciaCarolina.py", line 86, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.gp.DetectarDiferenciasA(Incidencia_2012, IncidenciaSDE_A)&lt;BR /&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args))&lt;BR /&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;WARNING 000258: Output C:\CrimeMapping\workspace\CAROLINAGIS.gdb\Equals already exists&lt;BR /&gt;WARNING 000258: Output C:\CrimeMapping\workspace\CAROLINAGIS.gdb\Diferencia_Incidentes already exists&lt;BR /&gt;WARNING 000258: Output C:\CrimeMapping\workspace\CAROLINAGIS.gdb\Incidentes_tmp already exists&lt;BR /&gt;WARNING 000970: The join field id_incidente in the join table Incidentes_tmp is not indexed. To improve performance, we recommend that an index be created for the join field in the join table.&lt;BR /&gt;WARNING 000258: Output C:\CrimeMapping\workspace\CAROLINAGIS.gdb\Nuevos_Incidentes already exists&lt;BR /&gt;ERROR 000655: An error was encountered while Validating&amp;nbsp; Synchronize.&lt;BR /&gt;Failed to execute (DetectarDiferenciasA).&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;gt;&amp;gt;&amp;gt; &lt;BR /&gt;True&lt;/STRONG&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "C:\CrimeMapping\Replicacion\POLICIA\SyncComandanciaCarolina.py", line 86, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.gp.DetectarDiferenciasA(Incidencia_2012, IncidenciaSDE_A)&lt;BR /&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args))&lt;BR /&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;WARNING 000258: Output C:\CrimeMapping\workspace\CAROLINAGIS.gdb\Equals already exists&lt;BR /&gt;WARNING 000258: Output C:\CrimeMapping\workspace\CAROLINAGIS.gdb\Diferencia_Incidentes already exists&lt;BR /&gt;WARNING 000258: Output C:\CrimeMapping\workspace\CAROLINAGIS.gdb\Incidentes_tmp already exists&lt;BR /&gt;WARNING 000970: The join field id_incidente in the join table Incidentes_tmp is not indexed. To improve performance, we recommend that an index be created for the join field in the join table.&lt;BR /&gt;WARNING 000258: Output C:\CrimeMapping\workspace\CAROLINAGIS.gdb\Nuevos_Incidentes already exists&lt;BR /&gt;ERROR 000655: An error was encountered while Validating&amp;nbsp; Synchronize.&lt;BR /&gt;Failed to execute (DetectarDiferenciasA).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see we have a true, that means that the command line for overwrite is working&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does any one has any idea what could be happening? why is working find if I run the model but after exporting to python we got that error?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Diego Llamas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 10:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418638#M1435</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-27T10:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when I try to overwrite with Python</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418639#M1436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: bosewicht&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my experience, I've seen that exporting a model to python and running it sometimes has odd results like what you are experiencing.Are you trying to append the new data? if so, just use arcpy.Append_management() in your script. Or perhaps someone much better at python than myself would have a better solution for you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 11:56:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418639#M1436</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-27T11:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when I try to overwrite with Python</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418640#M1437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd move some of the join management stuff you are doing to the IN_MEMORY space.&amp;nbsp; You can still perform your selections and count processes there, but you can mitigate some of the locking issues (from my experience) by working with intermediate data in_memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, from what I understand the overwrite setting will not work as expected if you are not properly releasing references along the way.&amp;nbsp; This is another reason why I like the in_memory space to perform these kinds of things -- it is very easy to "clear" it when needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 12:15:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418640#M1437</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2012-11-27T12:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when I try to overwrite with Python</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418641#M1438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Wayne_Whitley&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I question whether the model was exported to script properly, and this is a common problem, see the blog:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Considerations when exporting a model to a Python script&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by jpardy84 and Dale Honeycutt on June 24, 2011&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2011/06/24/exportmodeltopy/"&gt;http://blogs.esri.com/esri/arcgis/2011/06/24/exportmodeltopy/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...I'd check the code along the lines and heed the warnings at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.gp.toolbox&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And if this was appropriately interpreted, it could be the env var overwrite property is being overridden by the toolbox settings, i.e., may be a default value.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 12:42:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418641#M1438</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-27T12:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when I try to overwrite with Python</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418642#M1439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use if statements to check if it exists on disk first, then delete it before creating a new file. However, most of the time the overwriteOutput works fine for me.&amp;nbsp; Make sure you do not have these files open in Catalog or ArcMap first because that can create locks.&amp;nbsp; This is how I handle this problem when the overwriteOutput is not properly working:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if arcpy.Exists(feature_class):
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(feature_class)

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would put this in front of all the feature classes that are not being overwritten with the environment setting to be safe.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:56:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418642#M1439</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T18:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when I try to overwrite with Python</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418643#M1440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Wayne_Whitley&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yeah, interesting and I did not check this out to the length I would like, but I have a problem with where the error trace back was made...although you guys are right about 'clean-up' or control of the outputs so that new outputs can be made, I cannot help being suspicious about the reference to _base.py from the geoprocessing folder in the install directory.&amp;nbsp; To messages are reported in reverse order with the failure being invalid args passed to the aforementioned _base.py.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You do have another execute error toward the beginning in the detecting differences, Validating Synchronize, so that's a good lead too.&amp;nbsp; I believe the Warnings are still executing the overwrites, just you are being served notice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I still think you have errors in converting the model that should be looked at - in fact you have 'red ink' comment lines recorded by the ModelBuilder export process telling you that hey, Houston, we (may) have a problem!&amp;nbsp; [hey, just a little humor I'm trying for here, so excuse me].&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps at least a little, sorry don't have more - suggest reading the ESRI blog on porting model to py provided.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 18:12:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418643#M1440</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-27T18:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when I try to overwrite with Python</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418644#M1441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Apparently the parameters are not valid in the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.gp.DetectarDiferenciasA(Incidencia_2012, IncidenciaSDE_A)
&lt;/PRE&gt;&lt;SPAN&gt;So, what parameters does that tool require, and are you sure they match with "Incidencia_2012" and "IncidenciaSDE_A"?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:56:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418644#M1441</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T18:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when I try to overwrite with Python</title>
      <link>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418645#M1442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Wayne_Whitley&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you solve your problem?&amp;nbsp; I am interested to know more, particularly how existing model and script tools are called by other custom gp tools or scripts....I don't know what you'd call this, a 'compound' tool?&amp;nbsp; It can make things a little more challenging to trace back and find where something isn't passed properly (and, as I suspect in your case, where something didn't convert properly from modelbuilder to python)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, I agree with Darren that the 'lost in translation' is evident at DetectarDifferenciasA, which if I am not mistaken is a separate custom model component?&amp;nbsp; If you can, would you please attach your custom toolbox housing these models for further troubleshooting - or provide some feedback, if you have solved your problem, how you did it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Dec 2012 12:07:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/problem-when-i-try-to-overwrite-with-python/m-p/418645#M1442</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-12-01T12:07:15Z</dc:date>
    </item>
  </channel>
</rss>

