Thursday, 31 August 2017

arcpy - python.exe has stopped working


A python script was written about 18 months ago by a person who has now left. It produced the required outputs then. I've been asked to run it again but with different (finer resolution) data inputs. The input dataset has been split into 20 sub-sets of approx 2,700 data points each. However, the script crashes ("python.exe has stopped working") after approx 300 data points have been processed (range 295 to 306 and does NOT always fail on the same record).


As its old(ish), the script was written using arcgisscripting and not arcpy. Broadly it does the following using cursors:



  1. For a given point, calculate the cost distance (using gp.CostDistance_sa) with a cutoff of 60 minutes travel time.

  2. Calls gp.ExtractValuesToPoints_sa to extract all the individual values at each data point and outputs a feature class to a file geodatabase.

  3. Reads the feature class created in b) above and writes the values to a CSV file (omitting any points with "No Data" (value -9999)).


Repeats 1, 2 and 3 for all remaining data points in the input file.



Processing time is approx. 1 minute per data point on average. Here are some relevant technical specifications:



  • The PC has a quad core Intel i7-2720QM CPU running at 2.20GHz with 8GB RAM running Windows 7 (64 bit).

  • Python version is 2.6.6 (shell also states "[MSC v,1500 32 bit (Intel)] on win32).

  • ArcMap 10.0 (SP4) is also installed.


I've tried running it on a different PC (so far without crashing). Currently the job is running successfully (but more slowly) on an older PC and has reached 419 records without crashing. The relevant specifications for this machine are:



  • Intel Core 2 DUO E7500 processor running at 2.93GHz with 4 GB RAM and 64bit Windows 7.

  • Python version 2.5.1 (shell also states "[MSC v,1310 32 bit (Intel)] on win32).


  • ArcMap 9.3 is installed (no mention of any Service Packs).


Can someone offer some advice about why the script seems to work for a while then crash and how to resolve it?


The fact that a different PC appears (so far) to handle the script suggests something "environmental".




As an update, the PC running ARCGIS 9.3 is still successfully processing the data and has reached 1,300 data points processed (and still counting). A colleague also ran the data on their PC running ARCGIS 10.1 - it crashed after 267 records on two separate occasions. Although not conclusive, the common thread seems to be that Arc 9.3 will process the data but Arc 10.x will not.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...