AnsweredAssumed Answered

Python Toolbox Initialization ArcPro Version 2.0 Vs ArcPro Version 2.2

Question asked by jim.howser@colliers.com on Aug 16, 2018

To my ArcPy Colleagues,

 

I have recently upgraded from ArcPro Version 2.0 to ArcPro Version 2.2, but have noticed substantial time differences when initializing custom python toolboxes.  I've reduced the code down to parameters and a blank external script and have started honing in on a few potential culprits including the number of parameters and the number of external scripts loaded.  It appears each parameter adds time to the initialization in ArcPro 2.2, however, has no influence on initialization time in ArcPro 2.0.  This time gets extended further when adding external scripts through this technique:

 

Import ModuleX

Import importlib

importlib.reload(ModuleX)

 

 

 

I am wondering if anyone else has had this issue and if they can explain why this issue is occurring and how to prevent it.  In addition, this exact same code in ArcMap initializes almost instantaneously with many more parameters and multiple Import calls to custom scripts.  I've attached a generic .pyt code so you can test the custom python toolbox in ArcPro yourself.  (the Import externalScript line is a placeholder for an external script so you can create this file and fill it with code, and you will see there is additional delay when initializing) 

 

Summarizing -  When running the Python Toolbox on ArcPro Version 2.0, the tool initializes instantly.  I only started noticing the problem when I upgraded to ArcPro 2.2 about a week ago.  So, clearly, it has something to do with the new version of ArcPro.  My solution for now is to downgrade to ArcPro Version 2.0, however, this is not ideal.  

 

Please let me know if you have any ideas or solutions to get this to work on ArcPro Version 2.2!

 

Thanks!

Outcomes