Monday 4 March 2019

arcpy - Esri Python Toolbox(pyt) corruption in ArcToolbox.dat


Symptoms:




  1. Open ArcCatalog and all tools within Python Toolbox(pyt) have a red-x error next to them claiming that "Arcpy module has no attribute Parameter"





  2. Close ArcCatalog




  3. Delete ArcToolbox.dat file in ~\AppData\Roaming\ESRI\Desktop10.2\ArcToolbox




  4. Open ArcCatalog, everything is fine with tools





  5. Run tools successfully




  6. Close ArcCatalog




  7. GOTO Symptom 1 .....





Seems like something in the geoprocessing results history is going wrong.


Any ideas for fixes?


I also want to maintain geoprocessing result history.



Answer



I just experienced the same problem. It looks like ArcGIS is caching the tools/scripts. If I refresh (F5) the toolbox, after a few seconds the toolsets and tools would show-up and work, but next time I open ArcCatalog it shows the red crosses again. If you rename the folder where the PYT is stored, it won't show the red crosses the first time, only after you've run one of the tools inside the PYT toolbox.


Disabling the Geoprocessing Results works.


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...