<?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: The exported python of a model is not running  in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816991#M1732</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I definitely agree with Joe on this one.&amp;nbsp; I would also venture that sometimes the exported script gets scrambled at times.&amp;nbsp; People tend to focus on the 'visual' of the model and don't clean up the steps they have taken to get there.&amp;nbsp; You can view the steps taken in the model and rearrange them in proper order and remove unneeded elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also... people often don't read the&lt;STRONG&gt; &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/exporting-a-model-to-a-python-script.htm"&gt;post-export requirements to make sure the script works. &amp;nbsp;&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you read that link, there are a &lt;STRONG&gt;least 10 places&lt;/STRONG&gt; where a working model can fail as a script when exported. Read the link (amongst others in that section) and evaluate your workflow.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Nov 2017 20:55:33 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-11-23T20:55:33Z</dc:date>
    <item>
      <title>The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816985#M1726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;“The exported python of a model is not running “&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Despite the fact that the model is running successfully in Arcmap 10.5, the exported python is not running as expected.&lt;/P&gt;&lt;P&gt;What might be the issue here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the screenshots below for more clarification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355523_de1.png" style="width: 620px; height: 398px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-3 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355525_de2.png" style="width: 620px; height: 398px;" /&gt;&lt;IMG alt="" class="image-4 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355526_de3.png" style="width: 620px; height: 398px;" /&gt;&lt;IMG alt="" class="image-5 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355527_de4.png" style="width: 620px; height: 398px;" /&gt;&lt;IMG alt="" class="image-6 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355528_de5.png" style="width: 620px; height: 398px;" /&gt;&lt;IMG alt="" class="image-7 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355529_de6.png" style="width: 620px; height: 398px;" /&gt;&lt;IMG alt="" class="image-8 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355530_de7.png" style="width: 620px; height: 535px;" /&gt;&lt;IMG alt="" class="image-9 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355531_de8.png" style="width: 620px; height: 398px;" /&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Alaa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 08:13:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816985#M1726</guid>
      <dc:creator>AlaaFlaifel</dc:creator>
      <dc:date>2017-06-05T08:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816986#M1727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might like to compare the script with the code sample in &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/reconcile-versions.htm#C_GUID-43129D1C-8BA3-4679-8517-125F547DB846"&gt;Reconcile Versions&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Also verify why OUT_LOG parameter is not active in the model.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 09:05:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816986#M1727</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2017-06-05T09:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816987#M1728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is really no guarantee exporting to python will work, as the python environment is often different from what you have in an interactive ArcMap session. I think for this reason, Esri (unfortunately IMHO) disabled the export to Python functionality in Pro. I think this is too bad, because this is a great path to get started programming using Python and arcpy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you populate the output log file parameter this may give you a clue. Another way to get some feed back (error messages) is to open a command window and run the python script like this:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;C:\saved\Python&amp;gt; cmd /c py.py&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;BTW please avoid spaces in pathnames, you are asking for trouble!&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/curtvprice/blog/2016/05/07/how-to-name-things-in-arcgis?sr=search&amp;amp;searchId=b8c22dbd-a574-4d3e-a762-0e84266e4249&amp;amp;searchIndex=0"&gt;https://community.esri.com/people/curtvprice/blog/2016/05/07/how-to-name-things-in-arcgis?sr=search&amp;amp;searchId=b8c22dbd-a574-4d3e-a762-0e84266e4249&amp;amp;searchIndex=0&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 15:25:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816987#M1728</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-06-05T15:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816988#M1729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alla,&lt;/P&gt;&lt;P&gt;I see that you have draged&amp;nbsp; "U.sde" form "Database Connections" category&amp;nbsp; then&amp;nbsp;doped it in your model, is that right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/384710_21.JPG" style="width: 440px; height: 179px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you did this The model will work fine but when you export it as a script and run it form windows it will not work.&lt;/P&gt;&lt;P&gt;the solution will be by saving your SDE connection to a local folder and drag&amp;nbsp; it to your model then export as python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/384711_22.JPG" style="width: 730px; height: 451px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 17:57:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816988#M1729</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2017-11-22T17:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816989#M1730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Ahmad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your suggestions but it didn't work with me too!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/384705_s00.png" style="width: 620px; height: 431px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/384706_s01.png" style="width: 620px; height: 303px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Nov 2017 12:46:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816989#M1730</guid>
      <dc:creator>AlaaFlaifel</dc:creator>
      <dc:date>2017-11-23T12:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816990#M1731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I can be of help here, but my most recent project has involved creating a checkout replica and subsequent check in.&amp;nbsp; Something that I've discovered is when you say "python, SDE, versions, replication, and connection files all in the same breath, there is bad juju to pay.&amp;nbsp; I tried to use the exact same path as the check in replica tool uses in arc map in a script and it errors out; I've gone to r"DriveLetter:\To\The\SDE_ConnectionFile"&amp;nbsp; in my script. Also, be aware that when dealing with versioning and/or replication, sometimes you will provide the feature class, and sometimes you provide the geodatabase (workspace in Python speak).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Nov 2017 20:26:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816990#M1731</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2017-11-23T20:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816991#M1732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I definitely agree with Joe on this one.&amp;nbsp; I would also venture that sometimes the exported script gets scrambled at times.&amp;nbsp; People tend to focus on the 'visual' of the model and don't clean up the steps they have taken to get there.&amp;nbsp; You can view the steps taken in the model and rearrange them in proper order and remove unneeded elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also... people often don't read the&lt;STRONG&gt; &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/exporting-a-model-to-a-python-script.htm"&gt;post-export requirements to make sure the script works. &amp;nbsp;&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you read that link, there are a &lt;STRONG&gt;least 10 places&lt;/STRONG&gt; where a working model can fail as a script when exported. Read the link (amongst others in that section) and evaluate your workflow.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Nov 2017 20:55:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816991#M1732</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-11-23T20:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816992#M1733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alla,&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the error message that you got?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see that you didn't define a value for the&amp;nbsp; location&amp;nbsp;of the Log file variable&amp;nbsp; (Reconcile_Versions_Log_2 = """)&lt;/P&gt;&lt;P&gt;it should be something like&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Reconcile_Versions_Log_2_ ="D:/Db/myLog.txt"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2017 14:35:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816992#M1733</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2017-11-28T14:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816993#M1734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks alot foe your help&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will check your solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Alaa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 05:08:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816993#M1734</guid>
      <dc:creator>AlaaFlaifel</dc:creator>
      <dc:date>2018-08-30T05:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: The exported python of a model is not running</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816994#M1735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I was able to run the python by using the following code instead of exported the model directly to python&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;arcpy.ImportToolbox(r"E:\tools\reconcile.tbx", "TBX")&lt;BR /&gt;arcpy.Model1_TBX()&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/420796_Clip_221.jpg" /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alaa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 07:02:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/the-exported-python-of-a-model-is-not-running/m-p/816994#M1735</guid>
      <dc:creator>AlaaFlaifel</dc:creator>
      <dc:date>2018-08-30T07:02:23Z</dc:date>
    </item>
  </channel>
</rss>

