<?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: 64-bit ArcPy Not releasing Python Process on Completion in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1028452#M60027</link>
    <description>&lt;P&gt;Hi Paul,&amp;nbsp;I have the same problem, only with your suggestion the process ends. Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Feb 2021 12:28:11 GMT</pubDate>
    <dc:creator>RTRC_BOGLicense_Mgr</dc:creator>
    <dc:date>2021-02-19T12:28:11Z</dc:date>
    <item>
      <title>64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216307#M16646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a command script to run an arcpy process on ArcMap 10.6 - 64-bit arcpy. On successfully completing the script, the process ends - but doesn't release/kill the python.exe (or pythonw.exe), therefore the bat script hangs and doesn't finish. In the script below, its the&amp;nbsp;&lt;SPAN&gt;arcpy.mapping.ListDataFrames that causes the process to hang (that was fun narrowing down...). Comment it out and python terminates correctly. If i run this in 32 bit python terminates correctly - so just 64 bit. I'm thinking esri bug? Am I missing something?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;BR /&gt;Eric&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cleaned up script (may have missed something here) but it says the script is Finished.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import string&lt;BR /&gt;import gc&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def main():&lt;BR /&gt; print("Completion Script is Starting")&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument("D:\WOBufferScripts\LeakSurveyScripts.mxd")&lt;BR /&gt; # Running this causes python to not close.&lt;BR /&gt; dataFrame = arcpy.mapping.ListDataFrames(mxd)[0]&lt;BR /&gt; del dataFrame&lt;BR /&gt; del mxd&lt;BR /&gt; gc.collect()&lt;BR /&gt; print("Completion Script Has Finished")&lt;/P&gt;&lt;P&gt;if __name__ == "__main__":&lt;BR /&gt; main()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 14:02:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216307#M16646</guid>
      <dc:creator>EricFulcher1</dc:creator>
      <dc:date>2020-06-11T14:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216308#M16647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mention batch file.&amp;nbsp; Does the script terminate outside of the batch file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 15:24:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216308#M16647</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-06-11T15:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216309#M16648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its a runscript.bat file and no it never returns from the python process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is just me typing quick but&lt;/P&gt;&lt;P&gt;arcpy script1.py&lt;/P&gt;&lt;P&gt;arcpy.script2.py&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It never gets to script2 even tho script1 is in fact finished.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 15:53:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216309#M16648</guid>
      <dc:creator>EricFulcher1</dc:creator>
      <dc:date>2020-06-11T15:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216310#M16649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How many MXDs have you tried it with?&amp;nbsp; Does it fail on all of them or just this one?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 15:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216310#M16649</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-06-12T15:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216311#M16650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have value Joshua! Created new mxd, added 2 layers and the process closed successfully. It was a 10.2.1 mxd originally. wonder what it doesn't like.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 19:29:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216311#M16650</guid>
      <dc:creator>EricFulcher1</dc:creator>
      <dc:date>2020-06-12T19:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216312#M16651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I marked &lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;‌ 's answer correct since he provided the hint as to the check you didn't try&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 19:55:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216312#M16651</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-06-12T19:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216313#M16652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;64-bit ArcGIS (ArcPy and other software) doesn't support all workspaces that 32-bit ArcGIS does, e.g., personal geodatabases.&amp;nbsp; If the MXD contains one of these workspaces, a 64-bit process can easily hang trying to process it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 20:41:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216313#M16652</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-06-12T20:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216314#M16653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see how you have the POV to mark this correct. Must get reputation points or something.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2020 23:06:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216314#M16653</guid>
      <dc:creator>EricFulcher1</dc:creator>
      <dc:date>2020-06-24T23:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216315#M16654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua. Actually - the mxd has about 20 SDE Feature classes. I found if I rebuild the mxd from scratch (same FCs) - same issue. But by trial and error - if I remove one FC (Oracle SDE GDB) it magically works now. Go figure.....Doubt I'll get esri to debug this. Other FCs in the same feature dataset dont' impact it. weird......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2020 23:11:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216315#M16654</guid>
      <dc:creator>EricFulcher1</dc:creator>
      <dc:date>2020-06-24T23:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216316#M16655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to identify incompatible workspaces? I'm currently running into this similar issue where an automated publishing script running on 64 Bit Arcpy doesn't release it's process. This script has been working for years for multiple mxd's, but has only just now shown this behaviour after we upgraded to ArcServer 10.8.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2020 13:52:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216316#M16655</guid>
      <dc:creator>ChrisWalsh</dc:creator>
      <dc:date>2020-10-12T13:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216317#M16656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume this is still in relation to Oracle EGDB FCs, so this reply is coming from that angle/perspective.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;after we upgraded to ArcServer 10.8&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Can you elaborate?&amp;nbsp; Did you mean you upgraded the Oracle EGDB schema to 10.8?&amp;nbsp; Or, are you running the scripts from ArcPy on ArcGIS Enterprise machines and those were upgraded to 10.8?&amp;nbsp; Or, do you mean both?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2020 15:29:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216317#M16656</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-10-12T15:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216318#M16657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apologies, the update to 10.8 seems to have nothing to do with it. I tried running our automated publishing script against a 10.6 environment and the same thing is happening. 10.6.1 Server, 10.6.1 schema.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2020 10:20:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/216318#M16657</guid>
      <dc:creator>ChrisWalsh</dc:creator>
      <dc:date>2020-10-13T10:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1019145#M59608</link>
      <description>&lt;P&gt;Hey, We're getting the same issue for both 32 &amp;amp; 64bit and it only started happening around an installed Windows update KB4593226. Prior to the update our python jobs running via Scheduled Tasks runs through but will not run on the next schedule as the process is already running, due to the fact the process never terminates. We have debugged sys.exit() and it is firing correctly. Our only workaround is to have the following code:&lt;BR /&gt;os.kill(os.getpid(),9)&lt;BR /&gt;This ensures the process terminates and that batch processing continues.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 16:14:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1019145#M59608</guid>
      <dc:creator>PaulBatley</dc:creator>
      <dc:date>2021-01-22T16:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1028452#M60027</link>
      <description>&lt;P&gt;Hi Paul,&amp;nbsp;I have the same problem, only with your suggestion the process ends. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 12:28:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1028452#M60027</guid>
      <dc:creator>RTRC_BOGLicense_Mgr</dc:creator>
      <dc:date>2021-02-19T12:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1029486#M60055</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Just to update further. After KB4598243 which superceded the patch mentioned above, the issue started affecting the Interop tool too. With the FME.exe process now not closing down and causing a further problem as the file handles for the logging were inherited and therefore the python Scheduled Task couldn't re-run because of the orphaned FME process. The code below resolved the orphaned FME not shutting down with the Standard signum (,9)&amp;nbsp; kill signal.&lt;/P&gt;&lt;P&gt;## Python for dealing with child processes&lt;BR /&gt;parentProcess = psutil.Process(os.getpid())&lt;BR /&gt;children = parentProcess.children(recursive=True)&lt;BR /&gt;for ofspring in children:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; localLogger.write("Child ProcessID: {}".format(ofspring.pid) + " terminating...")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; os.kill(ofspring.pid,9)&lt;BR /&gt;localLogger.write("Python Process PID: {}".format(os.getpid()) + " terminating...")&lt;BR /&gt;os.kill(os.getpid(),9)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 10:50:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1029486#M60055</guid>
      <dc:creator>PaulBatley</dc:creator>
      <dc:date>2021-02-23T10:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1100982#M62531</link>
      <description>&lt;P&gt;Sweet - I'm going to so try this.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 19:40:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1100982#M62531</guid>
      <dc:creator>EricFulcher1</dc:creator>
      <dc:date>2021-09-22T19:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1105365#M62588</link>
      <description>&lt;P&gt;Great solution! This fixes it for me and should be marked as the solution imo.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 21:46:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1105365#M62588</guid>
      <dc:creator>willemjenniskens</dc:creator>
      <dc:date>2021-10-06T21:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1105507#M62589</link>
      <description>&lt;P&gt;If I could figure out how to change the solution flag - I would. Somebody looking for points marked it as solved.... But yes this is the solution.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 13:02:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1105507#M62589</guid>
      <dc:creator>EricFulcher1</dc:creator>
      <dc:date>2021-10-07T13:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit ArcPy Not releasing Python Process on Completion</title>
      <link>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1247316#M66510</link>
      <description>&lt;P&gt;Thanks, this worked great for me.&amp;nbsp; My PY was completing but not exiting and moving on to the next script in the BAT file.&amp;nbsp; Once I added that piece of code at the end, works great.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 16:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/64-bit-arcpy-not-releasing-python-process-on/m-p/1247316#M66510</guid>
      <dc:creator>DarrylKlassen1</dc:creator>
      <dc:date>2023-01-11T16:22:35Z</dc:date>
    </item>
  </channel>
</rss>

