0

I have a Python script that will successfully complete when run from the Python window in ArcMap or ArcCatalog, however, when I run as a standalone it will cause python.exe stopped working crash once it completes. I've tried from a command prompt and a couple different IDEs with the same result.

The target files and updates complete before the crash and when I compare the results from the stand alone script to the one run within the Python window they appear identical. I've placed print statements at various locations including on the last line to help with debugging and all of them print. Since the crash is happening after the all lines in the script have been run, I'm not sure how to further debug this. I'm running ArcGIS 10.5.1.

If I comment out the arcpy.CreateRapidGraphic line then the crash does not occur.

I'm primarily running via a command prompt

C:\Python27\ArcGIS10.5\python.exe D:\Projects\py\createmap.py

but have also tried double-clicking and running in visual studio code.

The last lines of my code are similar to this:

arcpy.CreateRapidGraphic_defense(geodb, areaOfInterestLyr, productType, version, mapDocumentWork, rasterLyr)
print "graphic done"
arcpy.CheckInExtension('defense')
arcpy.CheckInExtension('foundation')
arcpy.CheckInExtension('spatial')
arcpy.CheckInExtension('3D')
print "checkin done"
  • 1
    Can you share your script? – Stella Jul 29 at 17:04
  • 1
    how are you actually executing the script (e.g. typing the explicit command on the CLI or double-clicking the file?). what in your observation indicates that a crash has occurred? – Paul H Jul 29 at 18:26
  • Please use the edit button beneath your question to revise it with any requested clarifications. – PolyGeo Jul 29 at 19:19
  • Are you working with a geometric network? If so, I may have seen something similar a few years ago at gis.stackexchange.com/questions/260788/… – PolyGeo Jul 29 at 19:24
  • Note that it may not truly be the last lines that are causing a crash, if it's crashing on exit. If it crashes reliably then I'd comment out one call to arcpy at a time until it (hopefully) stops – mikewatt Jul 29 at 19:43
0

Usually, it is related to the python version that you have installed or specific machine configuration, I had a similar issue with a script that in one machine was working perfectly but on another one, it was crashing. Check if the python IDLE match the one on Arcmap. You can change it on the environment variables on your computer by changing the python paths.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.