<?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: Extending geoprocessing through Python modules - toolbox not in arcpy! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449719#M35207</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The warning is that it is best practice to use a alias, which I did.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue is that the toolbox showed up in the System Tools as promised, but it is not available from arcpy without running ImportToolbox. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Sep 2015 19:59:51 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2015-09-27T19:59:51Z</dc:date>
    <item>
      <title>Extending geoprocessing through Python modules - toolbox not in arcpy!</title>
      <link>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449717#M35205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After having it suggested by &lt;A href="https://community.esri.com/migrated-users/3174" target="_blank"&gt;Drew Flater&lt;/A&gt;​ and &lt;A href="https://community.esri.com/migrated-users/3208" target="_blank"&gt;Ghislain Prince&lt;/A&gt;​ at the Esri UC, I am attempting to use the&lt;A href="http://blogs.esri.com/esri/arcgis/2013/08/13/extending-geoprocessing-through-python-modules/" rel="nofollow noopener noreferrer" target="_blank"&gt; extending geoprocessing guidance&lt;/A&gt; to make a toolbox easily accessible to ArcMap and Python as a system toolbox, using distutils.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a toolbox with a model in it, ran the distutil stuff (I even figured out to create an msi to install it silently!).&lt;/P&gt;&lt;P&gt;I can run it from ArcMap. Here's my GP dialog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Executing: Foo
Start Time: Fri Sep 25 17:30:36 2015
Executing (Calculate Value): CalculateValue "chr(12)*3 + "Hello world" + chr(12)*3" # Variant
Start Time: Fri Sep 25 17:30:36 2015
Value =&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello world&amp;nbsp;&amp;nbsp; 
Succeeded at Fri Sep 25 17:30:36 2015 (Elapsed Time: 0.08 seconds)
Succeeded at Fri Sep 25 17:30:36 2015 (Elapsed Time: 0.09 seconds)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All well and good. But I don't see in arcpy as promised.&lt;/P&gt;&lt;P&gt;(I thought this would be available from arcpy without ImportToolbox)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.Foo_footbx()
Runtime error 
Traceback (most recent call last):
&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
AttributeError: 'module' object has no attribute 'Foo_footbx'&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong or does this only work with pyt files? The guidance seems to imply tbx files should work too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached a zip of my attempt. One thing not clear from the help - do I need to edit __init__.py or footbx.py? If so what goes there?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:04:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449717#M35205</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T20:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extending geoprocessing through Python modules - toolbox not in arcpy!</title>
      <link>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449718#M35206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;on iThingy so I cant test, but I do remember some warning about using the alias&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-functions/importtoolbox.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-functions/importtoolbox.htm"&gt;ImportToolbox—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I presume you can ignore the rest&lt;/P&gt;&lt;P&gt;The link you provided for 10.3.1 is&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/python/extending-geoprocessing-through-python-modules.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/python/extending-geoprocessing-through-python-modules.htm"&gt;http://desktop.arcgis.com/en/desktop/latest/analyze/python/extending-geoprocessing-through-python-modules.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;​just in case you see any updated information&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Sep 2015 01:29:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449718#M35206</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-09-26T01:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Extending geoprocessing through Python modules - toolbox not in arcpy!</title>
      <link>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449719#M35207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The warning is that it is best practice to use a alias, which I did.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue is that the toolbox showed up in the System Tools as promised, but it is not available from arcpy without running ImportToolbox. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2015 19:59:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449719#M35207</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-09-27T19:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extending geoprocessing through Python modules - toolbox not in arcpy!</title>
      <link>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449720#M35208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok clear now...&lt;BR /&gt;The only way I have distributed toolboxes is for people to unzip a zip files which contains a script or scripts and ​a toolbox in a folder.&amp;nbsp; So people add the toolbox from the folder/location where they unzipped it. I haven't even tried to see if putting a toolbox in esri's toolbox folder works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both ArcGIS and ArcGIS Pro are specific about having to import toolboxes before they can be used in scripts&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/functions/importtoolbox.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/functions/importtoolbox.htm"&gt;ImportToolbox—ArcPy Functions | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-functions/importtoolbox.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-functions/importtoolbox.htm"&gt;ImportToolbox—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;so according to your docs distutils is supposed to solve this.&amp;nbsp; I would contact them directly.&lt;/P&gt;&lt;P&gt;EDIT&lt;/P&gt;&lt;P&gt;of course everything is installed in the site-packages folder in python...The only other thing I can think of is if you have multiple versions of python and the correct path not being picked up...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2015 23:02:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449720#M35208</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-09-27T23:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Extending geoprocessing through Python modules - toolbox not in arcpy!</title>
      <link>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449721#M35209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;o&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;f course everything is installed in the site-packages folder in python...The only other thing I can think of is if you have multiple versions of python and the correct path not being picked up.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I could buy that if I couldn't run the tool from ArcMap, but I can. The arcpy I'm using is the ArcMap python prompt so I really am mystified. I will open a support incident.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;This would be pretty cool if I could figure out how to make it work. What I do now is just drop a our custom toolbox desktop install folder's ArcToolbox folder (using an msi) - which works, the toolbox shows up in the System Toolboxes, BUT my custom tools won't work from arcpy unless I import them with ImportToolbox.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2015 01:18:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449721#M35209</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-09-28T01:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extending geoprocessing through Python modules - toolbox not in arcpy!</title>
      <link>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449722#M35210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keep us posted.&amp;nbsp; I dont use arcmap's python so I can't help.&amp;nbsp; I use pythonwin and pyscripter for 2.7.x and 3.4.x&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2015 01:40:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449722#M35210</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-09-28T01:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extending geoprocessing through Python modules - toolbox not in arcpy!</title>
      <link>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449723#M35211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't get my toolbox to show up in the Systems Tools. I've tried to follow the instructions at &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/python/extending-geoprocessing-through-python-modules.htm"&gt;extending-geoprocessing-through-python-modules&lt;/A&gt;&amp;nbsp;very closely. The reason may be that we do not actually install our python framework via a python installer. Our Windows installer delivers the package as a hierarchy of folders and creates a .pth file in the python Lib/site-packages folder to "install" it. Setup.py has never existed. We've been doing it this way for some time now, but without an accompanying toolbox and tools. Does anyone have relevant experience or knowledge?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2020 21:40:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extending-geoprocessing-through-python-modules/m-p/449723#M35211</guid>
      <dc:creator>AlanStewart</dc:creator>
      <dc:date>2020-01-14T21:40:13Z</dc:date>
    </item>
  </channel>
</rss>

