<?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 Pro crash when using memory or in_memory in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262893#M66975</link>
    <description>&lt;P&gt;Hi Shaun,&lt;/P&gt;&lt;P&gt;Here is a subset of the input data. I tested and get the same issue with this. I don't think it is related to the input data as it works on a different computer, reading the same data from the network drive. I have also tried it locally on my computer with no luck.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2023 05:17:51 GMT</pubDate>
    <dc:creator>HarrySmiles</dc:creator>
    <dc:date>2023-03-01T05:17:51Z</dc:date>
    <item>
      <title>Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262820#M66961</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;I updated from ArcGIS Pro 3.0.3 to 3.1 yesterday, and since then any time I try to write anything into "memory" or "in_memory" it causes ArcGIS Pro to crash.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HarrySmiles_0-1677626972532.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63973iCDC17B5CB2194AA5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HarrySmiles_0-1677626972532.png" alt="HarrySmiles_0-1677626972532.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;This is an example of some code, but everything I have tried with memory or in_memory causes the same issue.&amp;nbsp;&amp;nbsp;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;MakeFeatureLayer_management&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;input_locations&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;input_location_layer&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;input_name_field&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt; = '&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;location&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CopyFeatures_management&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;input_location_layer&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"memory&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;location&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;_facility"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have tried doing a full uninstall (including deleting all the Pro folders and registry&amp;nbsp;entries), and I've also tried creating a new Python Environment but get the same issue.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Feb 2023 23:31:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262820#M66961</guid>
      <dc:creator>HarrySmiles</dc:creator>
      <dc:date>2023-02-28T23:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262844#M66962</link>
      <description>&lt;P&gt;to test, skip the substitution and use the actual field names and locations&lt;/P&gt;&lt;P&gt;eg dump,&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;f"{input_name_field} = '{location}'") and this f"memory\\{location}_facility"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 00:49:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262844#M66962</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-03-01T00:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262864#M66963</link>
      <description>&lt;P&gt;I tried running the code in a notebook outside of the loop with everything hard coded and get the same issue unfortunately.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;MakeFeatureLayer_management&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;input_locations&lt;/SPAN&gt;&lt;SPAN&gt;, 'location_layer_CRAN'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"code&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;= 'CRAN&lt;/SPAN&gt;&lt;SPAN&gt;'"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CopyFeatures_management&lt;/SPAN&gt;&lt;SPAN&gt;('location_layer_CRAN'&lt;/SPAN&gt;&lt;SPAN&gt;, "memory&lt;/SPAN&gt;&lt;SPAN&gt;\\CRAN&lt;/SPAN&gt;&lt;SPAN&gt;_facility"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I don't know enough about the how the memory or in_memory workspaces work to debug this but I'm now confident they are the issue. I created a tempory filegeodatabase and used that instead of memory and it works.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;MakeFeatureLayer_management&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;input_locations&lt;/SPAN&gt;&lt;SPAN&gt;, 'location_layer_CRAN'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"code&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;= 'CRAN&lt;/SPAN&gt;&lt;SPAN&gt;'"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CopyFeatures_management&lt;/SPAN&gt;&lt;SPAN&gt;('location_layer_CRAN'&lt;/SPAN&gt;&lt;SPAN&gt;, "c:\\aaa\\temp.gdb&lt;/SPAN&gt;&lt;SPAN&gt;\\CRAN&lt;/SPAN&gt;&lt;SPAN&gt;_facility"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Mar 2023 02:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262864#M66963</guid>
      <dc:creator>HarrySmiles</dc:creator>
      <dc:date>2023-03-01T02:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262869#M66964</link>
      <description>&lt;P&gt;Try adding a '\' to the memory: "\\memory\\CRAN_facility"&lt;/P&gt;&lt;P&gt;There is another thread on here that memory\\ fails, but \memory\\ works. I'll try to link it for reference.&lt;/P&gt;&lt;P&gt;Edit- Here is the &lt;A href="https://community.esri.com/t5/python-questions/existence-of-data-in-memory-and-in-memory/m-p/1248233" target="_blank" rel="noopener"&gt;thread&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 03:02:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262869#M66964</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-03-01T03:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262876#M66965</link>
      <description>&lt;P&gt;Thanks for the reply, but unfortunatley&amp;nbsp;I now get this error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR 000210: Cannot create output \memory\CRAN_facility&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That is using.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CopyFeatures_management&lt;/SPAN&gt;&lt;SPAN&gt;('location_layer_CRAN'&lt;/SPAN&gt;&lt;SPAN&gt;, "\\memory&lt;/SPAN&gt;&lt;SPAN&gt;\\CRAN&lt;/SPAN&gt;&lt;SPAN&gt;_facility"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;arcpy.CopyFeatures_management('location_layer_CRAN', "\memory\\CRAN_facility")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Mar 2023 03:11:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262876#M66965</guid>
      <dc:creator>HarrySmiles</dc:creator>
      <dc:date>2023-03-01T03:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262880#M66968</link>
      <description>&lt;P&gt;Man, that is troublesome! How about os.path.join('memory', 'CRAN_facility')?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 03:20:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262880#M66968</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-03-01T03:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262881#M66969</link>
      <description>&lt;P&gt;Try adding the r decorator to the string. These two worked for me, but the "memory\\CRAN_facility" gave me the error that you received.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.CopyFeatures_management(fc, r"memory\CRAN_facility")
arcpy.CopyFeatures_management(fc, os.path.join("memory", "CRAN_facility2"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 03:32:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262881#M66969</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-03-01T03:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262883#M66970</link>
      <description>&lt;P&gt;Same thing I'm afraid. I don't know enough about the underlying mechanism of the memory or in_memory workspaces, but I have a feeling that something has either moved with the upgrade or something got corrupted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;That said I kind of assumed that a full reinstall would have fixed the issue and it didn't.&lt;/P&gt;&lt;P&gt;I have tried running the code on a colleges computer and it worked on that one, which was also updated Pro to 3.1 yesterday. That tells me it isn't a code issue but an Arcpy or Python issue.&lt;/P&gt;&lt;P&gt;I have also tried cloning the environment but I get the same issue with the clone.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 03:39:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262883#M66970</guid>
      <dc:creator>HarrySmiles</dc:creator>
      <dc:date>2023-03-01T03:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262888#M66972</link>
      <description>&lt;P&gt;Have you submitted the crash dumps? If you send one to me, I can take a quick look to see if it's anything obvious. Are you using the default `arcgispro-py3` environment, or a custom environment?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 04:49:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262888#M66972</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2023-03-01T04:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262889#M66973</link>
      <description>&lt;P&gt;Thanks Shaun.&lt;/P&gt;&lt;P&gt;Our work firewall seems to block sending the dump but here is one.&lt;/P&gt;&lt;P&gt;That was using the default environment, but I have also cloned it and get the same. I did try to create a new environment using conda, then installed the arcpy package. When I try to import arcpy using that environment I got the below error so I gave up on that.&lt;/P&gt;&lt;P&gt;ImportError: DLL load failed while importing _arcgisscripting: The specified module could not be found.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 04:59:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262889#M66973</guid>
      <dc:creator>HarrySmiles</dc:creator>
      <dc:date>2023-03-01T04:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262891#M66974</link>
      <description>&lt;P&gt;OK, thanks for a quick post. It looks like the crash is happening very low level in the stack, when trying to read the relationship classes of the data. Is this dataset you're working with particularly old or otherwise have any special characteristics? I'm suspicious that there potentially is some lower level issue based on the fact that it failed again after a reinstallation and was working on your colleagues machine, unfortunately nothing obvious from that crash dump to point at a clear cause other than the relationship classes functions being loaded from a DLL fail.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 05:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262891#M66974</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2023-03-01T05:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262893#M66975</link>
      <description>&lt;P&gt;Hi Shaun,&lt;/P&gt;&lt;P&gt;Here is a subset of the input data. I tested and get the same issue with this. I don't think it is related to the input data as it works on a different computer, reading the same data from the network drive. I have also tried it locally on my computer with no luck.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 05:17:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1262893#M66975</guid>
      <dc:creator>HarrySmiles</dc:creator>
      <dc:date>2023-03-01T05:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Pro crash when using memory or in_memory</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1263335#M66978</link>
      <description>&lt;P&gt;After some advise I tried another uninstall and full folder wipe, then reinstalled and it seems to have fixed the issue. I'm not sure what changed as I had done that, but I'm back up and running now.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 23:15:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-pro-crash-when-using-memory-or-in-memory/m-p/1263335#M66978</guid>
      <dc:creator>HarrySmiles</dc:creator>
      <dc:date>2023-03-01T23:15:21Z</dc:date>
    </item>
  </channel>
</rss>

