<?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: Python crashes when trying to run arcpy.ListRasters in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388253#M30678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should probably look for specific reasons why you think it runs slower and validate via testing.&amp;nbsp;I wouldn't just dismiss a GP toolbox as the reason.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Nov 2017 16:30:21 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2017-11-22T16:30:21Z</dc:date>
    <item>
      <title>Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388248#M30673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a Python script that I have been using for the past year but I recently updated my computer to Windows 10 and now Python is crashing when trying to run the script. I was able to isolate the crash to line 4&amp;nbsp;below where I am trying to list the rasters from my input folder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The inputFldr variable is a user input from a Tkinter GUI I created for this script. The only thing that happens before this section of code is receiving the various user inputs from the Tkinter GUI and assigning them to variables, as well as creating a few output folders. All of this happens with no problem and then Python crashes when trying to execute the red line. I am using Python 2.7.13 and ArcGIS Desktop 10.5.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have an idea why this is happening? I am lost. Even did a try/except around line 4 and Python still crashed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;sr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4326&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; inputFldr
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outputCoordinateSystem &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sr
rasters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListRasters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:50:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388248#M30673</guid>
      <dc:creator>AlexTurner4</dc:creator>
      <dc:date>2021-12-11T17:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388249#M30674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to add a wildcard value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;rasters = arcpy.ListRasters('*')
&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;&lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/functions/listrasters.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://pro.arcgis.com/en/pro-app/arcpy/functions/listrasters.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:50:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388249#M30674</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T17:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388250#M30675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, actually my original code was rasters = arcpy.ListRasters('*', 'ALL') and it also crashed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 16:03:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388250#M30675</guid>
      <dc:creator>AlexTurner4</dc:creator>
      <dc:date>2017-11-22T16:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388251#M30676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have no way of knowing for sure, but your Tkinter GUI is likely part of the problem.&amp;nbsp;You'll have to research how to successfully implement that, but from what I've read it doesn't play nicely in ArcGIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to switch gears and build an Add-In or just get creative with building a Toolbox for your GUI instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 16:11:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388251#M30676</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2017-11-22T16:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388252#M30677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, I was hoping to avoid building another tool to run this but I may have to. The Windows 10 upgrade was not my choice and this isn't the only problem with ArcGIS tools I've had since. Bummer cause this tool ran much faster using Tkinter than within Arc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 16:19:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388252#M30677</guid>
      <dc:creator>AlexTurner4</dc:creator>
      <dc:date>2017-11-22T16:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388253#M30678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should probably look for specific reasons why you think it runs slower and validate via testing.&amp;nbsp;I wouldn't just dismiss a GP toolbox as the reason.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 16:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388253#M30678</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2017-11-22T16:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388254#M30679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for high-jacking this thread, but can you list the other problems you've had with Windows 10 and ArcGIS tools. &amp;nbsp;My org is still at Windows 7, but we should be moving to Win10 in early 2018 as an enterprise. &amp;nbsp;I would appreciate the knowledge and it might help other GeoNet users.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 16:41:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388254#M30679</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2017-11-22T16:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388255#M30680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't say for sure that Windows 10 is the culprit (correlation not equal to causation) but the main problems I have been having are working with rasters via Python Scripts. I have another script that crashes on a line where I am running the Raster calculator. Always worked with no problem until the Windows 10 upgrade. Although the actual Raster Calculator tool in ArcMap works for me, it always crashes when using Python. That is the only other specific problem I can think of right now that I noticed after upgrading. I had to reinstall ArcGIS and all my Python modules after the upgrade so something could have gone wrong there as well.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 16:56:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388255#M30680</guid>
      <dc:creator>AlexTurner4</dc:creator>
      <dc:date>2017-11-22T16:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388256#M30681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;are you getting an empty list returned&amp;nbsp; (e.g.&amp;nbsp; &amp;nbsp;[ ] )&amp;nbsp; or an error?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If just an empty set, print out the valid of you inputFldr&amp;nbsp; to make sure 1) it is valid (do this in the program, before the point it crashes), and 2) that it contains rasters (set up the Python window with the same env.workspace and check it..&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am testing on a window 7 machine, so if it is a win10 issue, I have no way to test.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 17:45:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388256#M30681</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-11-22T17:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388257#M30682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't get an error of any kind. Python just crashes. I also printed out the valid of inputFldr and confirmed that everything is alright there, even copied it and used in ArcMap Python window. The ListRasters() command worked within ArcMap so I am assuming it is something with the Tkinter GUI and/or Windows 10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 17:51:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388257#M30682</guid>
      <dc:creator>AlexTurner4</dc:creator>
      <dc:date>2017-11-22T17:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Python crashes when trying to run arcpy.ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388258#M30683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case it helps anyone else, I was able to finally get my script to run again successfully. I moved the import line shown below from the beginning of my script to right before I actually utilize ogr in the script, which is after the ListRasters line. I just happened to stumble upon this solution while rebuilding the script. No idea why it works by moving that line, but it does. Thanks for all the suggestions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; osgeo &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; ogr &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Nov 2017 17:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-crashes-when-trying-to-run-arcpy/m-p/388258#M30683</guid>
      <dc:creator>AlexTurner4</dc:creator>
      <dc:date>2017-11-27T17:38:17Z</dc:date>
    </item>
  </channel>
</rss>

