<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python cache for custom toolbox: why? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393228#M17383</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is a python 3 thing&amp;nbsp;&lt;/P&gt;&lt;P&gt;some links on Stack in this thread&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://stackoverflow.com/questions/16869024/what-is-pycache" title="https://stackoverflow.com/questions/16869024/what-is-pycache"&gt;python - What is __pycache__? - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are links on how to disable it if it is a real issue for you&lt;/P&gt;&lt;P&gt;I just delete the __pycache__ folder(s) in my module path before moving to a new location.&amp;nbsp; An inconvenience but not one that can't be overcome&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 May 2019 09:15:18 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2019-05-15T09:15:18Z</dc:date>
    <item>
      <title>Python cache for custom toolbox: why?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393227#M17382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: georgia, palatino, serif; font-size: 22px;"&gt;ArcGIS Pro : Python cache for&amp;nbsp;custom toolbox&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;ArcGIS Desktop versus ArcGIS Pro : custom toolbox&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;I am&amp;nbsp;writing Python scripts and modules&amp;nbsp;for a toolbox. Everything (toolbox, scripts, modules) is&amp;nbsp;kept in one folder ("Toolbox Version 1"). The tool scripts import from the modules (e.g. "import helper"). Some modules import from others in the same folder.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;To make a new version of the toolbox, I can simply copy the folder as&amp;nbsp;"Toolbox Version 2" and work there. The scripts are enhanced and the &amp;lt;helper&amp;gt; module is revised. The Python files are revised, but not renamed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;ArcGIS Desktop (10.6.1) executes the tools in both toolboxes promptly and correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;ArcGIS Pro : ???????&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;In ArcGIS Pro 2.2.4, a toolbox's first-time use involves a lengthy wait (nearly a minute) before starting (for even the simplest script). Presumably, Pro is caching all of the Python for the project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;New project. Add&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;Toolbox Version 1&lt;/STRONG&gt;. Click on a script tool. Wait 45 seconds while the unexplained activity proceeds. &lt;EM&gt;Run the tools ... Time passes ...&lt;/EM&gt;&amp;nbsp;&lt;STRONG&gt;Add&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;Toolbox Version 2.&lt;/STRONG&gt; Will the new &amp;lt;helper&amp;gt; module be used? No, the old cached &amp;lt;helper&amp;gt; is used. Will removing Toolbox Version 1 do the trick? No. You will have to remove both toolboxes, save the project, &lt;EM&gt;and&lt;/EM&gt; exit ArcGIS Pro.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma, arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;WHY ???&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/message/808600-arcgispro-python-toolbox-problem-with-modulepy-cache-copy-problem"&gt;https://community.esri.com/message/808600-arcgispro-python-toolbox-problem-with-modulepy-cache-copy-problem&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2019 05:34:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393227#M17382</guid>
      <dc:creator>JackKelley</dc:creator>
      <dc:date>2019-05-15T05:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python cache for custom toolbox: why?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393228#M17383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is a python 3 thing&amp;nbsp;&lt;/P&gt;&lt;P&gt;some links on Stack in this thread&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://stackoverflow.com/questions/16869024/what-is-pycache" title="https://stackoverflow.com/questions/16869024/what-is-pycache"&gt;python - What is __pycache__? - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are links on how to disable it if it is a real issue for you&lt;/P&gt;&lt;P&gt;I just delete the __pycache__ folder(s) in my module path before moving to a new location.&amp;nbsp; An inconvenience but not one that can't be overcome&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2019 09:15:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393228#M17383</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-05-15T09:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python cache for custom toolbox: why?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393229#M17384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At the very least, I want ArcGIS Pro's toolbox &lt;STRONG&gt;Refresh &lt;/STRONG&gt;operation&amp;nbsp;to &lt;STRONG&gt;&lt;EM&gt;completely&lt;/EM&gt; refresh&lt;/STRONG&gt; the toolbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please try the attached test, to see how ArcGIS Pro can "misunderstand" the&amp;nbsp;__pycache__ for a toolbox.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will find version1 and version2 folders, each containing the same toolbox. Neither folder has a __pycache__ (to begin with).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Suppose you are working in a single project.&lt;/STRONG&gt; If you add both toolboxes, you can observe behaviour like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;Add version1 toolbox (no __pycache__)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;Add version2 toolbox (no __pycache__)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;Run Script in version2 (delay of about 50 seconds)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Start Time: Thursday, 16 May 2019 11:28:23 AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Running script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;lt;helper&amp;gt; version 2 :with: &amp;lt;helper_helper&amp;gt; version 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Script version 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Completed script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Succeeded at Thursday, 16 May 2019 11:28:28 AM (Elapsed Time: 4.37 seconds)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;__pycache__ then appears in version2&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;no __pycache__ in version1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;Run Script in version1 (no delay)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Start Time: Thursday, 16 May 2019 11:39:41 AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Running script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;lt;helper&amp;gt; version 2 :with: &amp;lt;helper_helper&amp;gt; version 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Script version 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Completed script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Succeeded at Thursday, 16 May 2019 11:39:41 AM (Elapsed Time: 0.03 seconds)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;no __pycache__ in version1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;Delete __pycache__ in version2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;Run Script in version1 (no delay)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Start Time: Thursday, 16 May 2019 11:41:38 AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Running script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;lt;helper&amp;gt; version 2 :with: &amp;lt;helper_helper&amp;gt; version 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Script version 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Completed script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Succeeded at Thursday, 16 May 2019 11:41:38 AM (Elapsed Time: 0.03 seconds)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;Run RefreshToolbox in version1&amp;nbsp; &amp;nbsp;(this reloads the imported modules)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Start Time: Thursday, 16 May 2019 11:45:23 AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Running script RefreshToolbox...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;lt;helper_helper&amp;gt; version 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;lt;helper_helper&amp;gt; version 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;lt;helper&amp;gt; version 2 :with: &amp;lt;helper_helper&amp;gt; version 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;lt;helper&amp;gt; version 1 :with: &amp;lt;helper_helper&amp;gt; version 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Completed script RefreshToolbox...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Succeeded at Thursday, 16 May 2019 11:45:23 AM (Elapsed Time: 0.07 seconds)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;__pycache__ then appears in version1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;Run Script in version1 (no delay)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Start Time: Thursday, 16 May 2019 11:46:30 AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Running script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;lt;helper&amp;gt; version 1 :with: &amp;lt;helper_helper&amp;gt; version 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Script version 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Completed script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Succeeded at Thursday, 16 May 2019 11:46:30 AM (Elapsed Time: 0.03 seconds)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2019 02:14:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393229#M17384</guid>
      <dc:creator>JackKelley</dc:creator>
      <dc:date>2019-05-16T02:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Python cache for custom toolbox: why?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393230#M17385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you editing one or more of the scripts during this process Jack? There are too many variables in importlib to make sense of what will happen if any of the python objects are retained or completely removed before using reload from importlib.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.python.org/3/library/importlib.html" title="https://docs.python.org/3/library/importlib.html"&gt;importlib — The implementation of import — Python 3.7.3 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2019 02:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393230#M17385</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-05-16T02:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python cache for custom toolbox: why?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393231#M17386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan, I understand that the &lt;EM&gt;reloads&lt;/EM&gt; (in RefreshToolbox using "Refresh.py", which I should not have to write) are &lt;EM&gt;potentially risky&lt;/EM&gt;. However, in this case the only difference between the versions is the version number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;"helper_helper.py" (version1)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;version_string = "&amp;lt;helper_helper&amp;gt; version 1"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;"helper.py"&amp;nbsp;(version1)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;version_string = "&amp;lt;helper&amp;gt; version 1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;import helper_helper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;version_string = "%s :with: %s" % (version_string, helper_helper.version_string)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;"Script.py"&amp;nbsp;(version1)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;import helper&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;def message (text):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage (text)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print (arcpy.GetMessages ())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;message (helper.version_string)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;message ("Script version 1")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;STRONG style="font-family: terminal, monaco, monospace; "&gt;"Refresh.py"&amp;nbsp;(version1) and&amp;nbsp;(version2)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;def message (text):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage (text)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print (arcpy.GetMessages ())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;from importlib import reload&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;import helper_helper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;message (helper_helper.version_string)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;reload (helper_helper)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;message (helper_helper.version_string)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;import helper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;message (helper.version_string)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;reload (helper)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;message (helper.version_string)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used "Store tool with relative path" for all tools.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see from my previous log of observations, ArcGIS Pro does not always look for the __pycache__ in the correct folder. And worse (see 3rd last item in the log, after deleting version2 __pycache__).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same bad behaviour seems to occur (within a single project) whether you add a toolbox to the project or simply find it by browsing to its folder. And as noted in the original question, the toolbox Remove operation does not remove all traces of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The toolbox right-click &lt;EM&gt;Refresh&lt;/EM&gt; operation merely says "Update the contents list to include any items that were recently added to this location".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that ArcGIS Pro's toolbox&amp;nbsp;&lt;EM&gt;Refresh&lt;/EM&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;operation&amp;nbsp;&lt;/SPAN&gt;should &lt;EM&gt;completely refresh&lt;/EM&gt; the toolbox, that is, &lt;EM&gt;completely revise its conception of where each (source) part of that toolbox is (stored as an operating-system file).&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2019 03:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-cache-for-custom-toolbox-why/m-p/393231#M17386</guid>
      <dc:creator>JackKelley</dc:creator>
      <dc:date>2019-05-16T03:45:24Z</dc:date>
    </item>
  </channel>
</rss>

