<?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: Refresh a Python Toolbox in ArcCatalog in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097797#M62374</link>
    <description>&lt;P&gt;Brilliant solution.&amp;nbsp;&amp;nbsp; Almost - but only works for ArcGIS Pro.&lt;/P&gt;&lt;P&gt;ArcCatalog is ArcGIS 10.x and thus uses Python 2.7, where this doesn't work. Some digging came up with just&lt;/P&gt;&lt;P&gt;reload(your-module)&lt;/P&gt;&lt;P&gt;or there's another reload in module imp:&lt;/P&gt;&lt;P&gt;import imp&lt;/P&gt;&lt;P&gt;imp.reload(your-module)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which works for python 2 and 3.2-3.3 although I don't think there's Pro version that uses any of these Python versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for putting me on the right path!&lt;/P&gt;</description>
    <pubDate>Mon, 13 Sep 2021 20:59:04 GMT</pubDate>
    <dc:creator>BerndtNording</dc:creator>
    <dc:date>2021-09-13T20:59:04Z</dc:date>
    <item>
      <title>Refresh a Python Toolbox in ArcCatalog</title>
      <link>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097389#M62350</link>
      <description>&lt;P&gt;I have incorporated the hack at the bottom of&amp;nbsp; &lt;U&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/debugging-python-code.htm" target="_blank" rel="noopener"&gt;this&lt;/A&gt;&lt;/U&gt; help page in order to work with python toolboxes in VS.&lt;/P&gt;&lt;P&gt;The hack works, but if I make changes to the code of any tool therin, save them and then refresh the toolbox in ArcCatalog, the tool runs the old code. It won't run the new code until I restart ArcCatalog, which is anything but fast. Is there anyway to refresh the toolbox without restarting ArcCatalog?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 22:44:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097389#M62350</guid>
      <dc:creator>BerndtNording</dc:creator>
      <dc:date>2021-09-10T22:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh a Python Toolbox in ArcCatalog</title>
      <link>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097390#M62351</link>
      <description>Did you try a right click on the updated toolbox or it’s containing folder and selecting refresh?&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Sep 2021 22:49:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097390#M62351</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-09-10T22:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh a Python Toolbox in ArcCatalog</title>
      <link>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097430#M62355</link>
      <description>&lt;P&gt;Yes, I refreshed the Toolbox as well as the folder containing the Toolbox.&amp;nbsp; This worked when all the code was in the .pyt. It seems that ArcCatalog is storing the code in the .py in memory and not re-reading it when the .pyt that references the .py is refreshed.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2021 16:41:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097430#M62355</guid>
      <dc:creator>BerndtNording</dc:creator>
      <dc:date>2021-09-11T16:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh a Python Toolbox in ArcCatalog</title>
      <link>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097495#M62363</link>
      <description>&lt;P&gt;I have the same issue when developing scripts for a Python toolbox which import classes or utilities from separate .py files inside the main tool .py file. The only way I can see changes in these files referenced within the tool is by restarting ArcGIS Pro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there a solution I would also love to know about it.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Sep 2021 22:45:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097495#M62363</guid>
      <dc:creator>nzjs</dc:creator>
      <dc:date>2021-09-12T22:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh a Python Toolbox in ArcCatalog</title>
      <link>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097529#M62364</link>
      <description>&lt;P&gt;I think (not sure), ArcGIS uses the compiled pyc file unless you explicitly reload the module in your toolbox.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# toolbox.pyt
import importlib

import your_module
importlib.reload(your_module)
from your_module import *


# To see changes made in modules you import in your_module, 
# you have to reload them in your_module, too:

# your_module.py
import importlib

import utility_functions
importlib.reload(utility_functions)
from utility_functions import *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 06:22:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097529#M62364</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-09-13T06:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh a Python Toolbox in ArcCatalog</title>
      <link>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097797#M62374</link>
      <description>&lt;P&gt;Brilliant solution.&amp;nbsp;&amp;nbsp; Almost - but only works for ArcGIS Pro.&lt;/P&gt;&lt;P&gt;ArcCatalog is ArcGIS 10.x and thus uses Python 2.7, where this doesn't work. Some digging came up with just&lt;/P&gt;&lt;P&gt;reload(your-module)&lt;/P&gt;&lt;P&gt;or there's another reload in module imp:&lt;/P&gt;&lt;P&gt;import imp&lt;/P&gt;&lt;P&gt;imp.reload(your-module)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which works for python 2 and 3.2-3.3 although I don't think there's Pro version that uses any of these Python versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for putting me on the right path!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 20:59:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-a-python-toolbox-in-arccatalog/m-p/1097797#M62374</guid>
      <dc:creator>BerndtNording</dc:creator>
      <dc:date>2021-09-13T20:59:04Z</dc:date>
    </item>
  </channel>
</rss>

