I've recently upgraded Pro from 3.0.3 to 3.5.2, and several of my Custom Python Toolboxes will now crash Pro if I run them a second time in a row. The tool works as expected, if I close and reopen Pro before running it again, but this isn't an issue I had on 3.0.3.
My code and input data are unchanged.
I'm curious if anyone else has experienced this behavior or has any insight into what might be causing this.
Thanks!
I wonder if the Python environment may need to be repaired? You can learn more about this workflow here - Repair an environment—ArcGIS Pro | Documentation
Hi Robert,
Thanks for the suggestion! My environment manager doesn't show the 'Warning icon' for the environment, and I didn't have the option to repair it. I did try to run the toolbox twice with a new clone of the default python environment and had the same issue.
Any other suggestions?
Well at least we know it's not a bad environment. Another thing to try is to create a new Python in a new Project. Add the old Python toolbox to the new project and copy and paste the original tool to the new toolbox. Run the tool again. Does ArcGIS Pro still crash?
Hi,
I'm having the same Problem: First run works, the second crashes PRO. After I reopen the project it works again for one time then crashes again.
Tried with different projects and Data, always crashes on the second run.
Tested the code again with PRO Version 3.3 and it runs several times without crashing.
There's a bug-report (BUG-000176923) on that issue, with what I can only assume is a joke as a workaround ("Use ArcGIS Pro 3.3, where the tool completes successfully.").
It specifies Windows 10 as OS, but PRO also crashes on my Windows 11 machine.
Hi Chris,
Have you found a solution for this? I haven't had any luck personally.
Best, Konrad
In reviewing the BUG-000176923 report, it does say it's currently under review. Hopefully it is fixed at ArcGIS Pro 3.7!
I have a script that reads a shapefile into a geodataframe, it always crashes the second time it is ran as of upgrading to 3.6 (from 3.5).
If I run the script it works the first time, if I run it again it crashes.
If I run the script it works, if I then make any changes to the script code and save, I can run it a second time with no crash. Is it not properly clearing the kernel or something?
There has been an update on BUG-000176923. It seems to not be reproducible.
I did some testing and it might have something to do with modules imported within the toolbox. We use an environment that has several modules more than the base-env. When we use toolboxes with that environment that only uses modules found in the base-env, it seems to work. As soon as we use toolboxes that use e.g. geopandas and/or psycopg2 the tool crashes on the second run.
@DFarming seems like geopandas could be the culprit, as it crashes on a geodataframe
@KonradBostrom is geopandas also imported in the toolboxes that crash your PRO-instances? This would second my suspicion on geopandas
Chris, that's an interesting observation. I do use several opensource GIS libraries in my tool. I might rewrite it to only use base modules and see if that fixes it. Thanks for mentioning.