<?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 errors importing custom tools from a ptyhon toolbox in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/errors-importing-custom-tools-from-a-ptyhon/m-p/184480#M14208</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Forum:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting errors importing custom tools from a ptyhon toolbox&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My scenario si as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have developed 3 python toolboxes with some tools:&lt;/P&gt;&lt;P&gt;- PythonToolbox1 &lt;STRONG&gt;PT1&lt;/STRONG&gt; with Tool11 and Tool12&amp;nbsp; &lt;STRONG&gt;T11&lt;/STRONG&gt; &lt;STRONG&gt;T12&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- PythonToolbox2 &lt;STRONG&gt;PT2&lt;/STRONG&gt; with Tool21 &lt;STRONG&gt;T21&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- PythonToolbox3 &lt;STRONG&gt;PT3&lt;/STRONG&gt; with Tool31 &lt;STRONG&gt;T31&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T11&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT1&lt;/STRONG&gt;)) the execution of &lt;STRONG&gt;T31&lt;/STRONG&gt; works fine&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T12&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT1&lt;/STRONG&gt;)) the execution of &lt;STRONG&gt;T31&lt;/STRONG&gt; works fine&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T21&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT2&lt;/STRONG&gt;)) the execution of T31 works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is, when I call JUST ONE AND ONLY ONE tool, &lt;STRONG&gt;T31&lt;/STRONG&gt; works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, if a tried to call more than one external tool from &lt;STRONG&gt;T31&lt;/STRONG&gt;, I get errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T11&lt;/STRONG&gt; and &lt;STRONG&gt;T12&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT1&lt;/STRONG&gt;)) the execution of &lt;STRONG&gt;T31&lt;/STRONG&gt; works wrong (it executes &lt;STRONG&gt;T11&lt;/STRONG&gt; but not &lt;STRONG&gt;T12&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line xxx, in execute&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "C:\xxxx\PT1.pyt", line xx, in T12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AttributeError: Object: Tool or environment &amp;lt;T12&amp;gt; not found&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T11&lt;/STRONG&gt; and &lt;STRONG&gt;T21&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT1&lt;/STRONG&gt;) and arcpy.ImportToolbox(&lt;STRONG&gt;PT2&lt;/STRONG&gt;)) the execution of &lt;STRONG&gt;T31&lt;/STRONG&gt; works wrong (it executes &lt;STRONG&gt;T11&lt;/STRONG&gt; but not &lt;STRONG&gt;T21&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line xxx, in execute&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "C:\xxxx\PT2.pyt", line xx, in T21&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AttributeError: Object: Tool or environment &amp;lt;T21&amp;gt; not found&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use in &lt;STRONG&gt;T31 &lt;/STRONG&gt;RemoveToolbox after using any call to a custom script,(and Import/Add Tool before calling them) but it still works wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that one and only one external tool can be called from &lt;STRONG&gt;T31, &lt;/STRONG&gt;but this make no sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas of this behaviour?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Antono&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Jul 2014 12:03:03 GMT</pubDate>
    <dc:creator>antoniogomez</dc:creator>
    <dc:date>2014-07-21T12:03:03Z</dc:date>
    <item>
      <title>errors importing custom tools from a ptyhon toolbox</title>
      <link>https://community.esri.com/t5/python-questions/errors-importing-custom-tools-from-a-ptyhon/m-p/184480#M14208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Forum:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting errors importing custom tools from a ptyhon toolbox&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My scenario si as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have developed 3 python toolboxes with some tools:&lt;/P&gt;&lt;P&gt;- PythonToolbox1 &lt;STRONG&gt;PT1&lt;/STRONG&gt; with Tool11 and Tool12&amp;nbsp; &lt;STRONG&gt;T11&lt;/STRONG&gt; &lt;STRONG&gt;T12&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- PythonToolbox2 &lt;STRONG&gt;PT2&lt;/STRONG&gt; with Tool21 &lt;STRONG&gt;T21&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- PythonToolbox3 &lt;STRONG&gt;PT3&lt;/STRONG&gt; with Tool31 &lt;STRONG&gt;T31&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T11&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT1&lt;/STRONG&gt;)) the execution of &lt;STRONG&gt;T31&lt;/STRONG&gt; works fine&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T12&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT1&lt;/STRONG&gt;)) the execution of &lt;STRONG&gt;T31&lt;/STRONG&gt; works fine&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T21&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT2&lt;/STRONG&gt;)) the execution of T31 works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is, when I call JUST ONE AND ONLY ONE tool, &lt;STRONG&gt;T31&lt;/STRONG&gt; works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, if a tried to call more than one external tool from &lt;STRONG&gt;T31&lt;/STRONG&gt;, I get errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T11&lt;/STRONG&gt; and &lt;STRONG&gt;T12&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT1&lt;/STRONG&gt;)) the execution of &lt;STRONG&gt;T31&lt;/STRONG&gt; works wrong (it executes &lt;STRONG&gt;T11&lt;/STRONG&gt; but not &lt;STRONG&gt;T12&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line xxx, in execute&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "C:\xxxx\PT1.pyt", line xx, in T12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AttributeError: Object: Tool or environment &amp;lt;T12&amp;gt; not found&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When calling &lt;STRONG&gt;T11&lt;/STRONG&gt; and &lt;STRONG&gt;T21&lt;/STRONG&gt; from &lt;STRONG&gt;T31&lt;/STRONG&gt; ( using importing arcpy.ImportToolbox(&lt;STRONG&gt;PT1&lt;/STRONG&gt;) and arcpy.ImportToolbox(&lt;STRONG&gt;PT2&lt;/STRONG&gt;)) the execution of &lt;STRONG&gt;T31&lt;/STRONG&gt; works wrong (it executes &lt;STRONG&gt;T11&lt;/STRONG&gt; but not &lt;STRONG&gt;T21&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line xxx, in execute&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; File "C:\xxxx\PT2.pyt", line xx, in T21&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AttributeError: Object: Tool or environment &amp;lt;T21&amp;gt; not found&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use in &lt;STRONG&gt;T31 &lt;/STRONG&gt;RemoveToolbox after using any call to a custom script,(and Import/Add Tool before calling them) but it still works wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that one and only one external tool can be called from &lt;STRONG&gt;T31, &lt;/STRONG&gt;but this make no sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas of this behaviour?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Antono&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 12:03:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/errors-importing-custom-tools-from-a-ptyhon/m-p/184480#M14208</guid>
      <dc:creator>antoniogomez</dc:creator>
      <dc:date>2014-07-21T12:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: errors importing custom tools from a ptyhon toolbox</title>
      <link>https://community.esri.com/t5/python-questions/errors-importing-custom-tools-from-a-ptyhon/m-p/184481#M14209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Antonio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have had very similar problems.&amp;nbsp; One way that usually makes this work (not that it is a very good way) is to import your toolboxes (in the correct order) from the python command window in ArcMap.&amp;nbsp; This is not ideal, but usually gets things to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a similar setup for some tools that I have create, lets call them BaseTools and CompositeTools.&amp;nbsp; The CompositeTools call tools from BaseTools, but BaseTools are all stand alone, they do not have dependencies on each other, nor on any tools other than Esri tools.&amp;nbsp; These tools are built within a Python site package, and distributed using this &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Extending_geoprocessing_through_Python_modules/002z0000002n000000/"&gt;technique&lt;/A&gt;.&amp;nbsp; This makes the PYT files appear as system toolboxes in ArcMap in 10.2, it doesn't work in 10.0 or 10.1, but it will make things consistent, and you can easily add the PYT files by calling a custom function on the site package: see below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To help make this work consistently here is what I do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add a method to the root of my site package called "add_toolbox"&amp;nbsp; The job of this method is to figure out where the PYT file is, check to see if it is already imported (remove it if it is) and then import it, so it looks like this (I put the other functions that I call at the end, I couldn't get them to paste here correctly) (also, I am importing arcpy within my function, but that is b/c of dependencies that I have so you may not do that there):&lt;/LI&gt;&lt;/UL&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14059466752683471" jivemacro_uid="_14059466752683471" modifiedtitle="true"&gt;
&lt;P&gt;def add_toolbox():&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ## List toolboxes and see if eaglepods6 is already installed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; eagle_pods_6_toolbox = arcpy.ListToolboxes("basetools")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(eagle_pods_6_toolbox) == 1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RemoveToolbox(_get_composite_toolbox_path())&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RemoveToolbox(_get_toolbox_path())&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddToolbox(_get_toolbox_path())&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddToolbox(_get_composite_toolbox_path())&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/P&gt;
&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;This is where it gets really strange, so this works great because I now have a function to load my toolboxes, this makes it easy to call from the command line, or from inside a python script that is using my tools, but it does not fix the one tool depending on the other tool problem.&amp;nbsp; To get that to work I had to add the following to my CompositeTools PYT file:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14059469693099344 jive_text_macro" jivemacro_uid="_14059469693099344" modifiedtitle="true"&gt;
&lt;P&gt;import arcpy&lt;/P&gt;
&lt;P&gt;import my_library&lt;/P&gt;
&lt;P&gt;my_library.add_core_toolbox()&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This function "add_core_toolbox" is almost the same as the above add toolbox function, but instead of adding both toolboxes (Composite and Base) it only adds the Base.&amp;nbsp; This ensures that when ArcMap is opening and loading PYTs, when it gets to the Composite one, it will force the Base one to load.&amp;nbsp; So my add_core_toolbox looks like this:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14059470958412435" jivemacro_uid="_14059470958412435" modifiedtitle="true"&gt;
&lt;P&gt;def add_core_toolbox():&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ## List toolboxes and see if eaglepods6 is already installed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; eagle_pods_6_toolbox = arcpy.ListToolboxes("basetools")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(eagle_pods_6_toolbox) == 1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RemoveToolbox(_get_toolbox_path())&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddToolbox(_get_toolbox_path())&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always make sure that I list the toolboxes, and remove the tool if it already exists.&amp;nbsp; This was added after trial and error, and seems to help ensure that the toolbox is loaded only once, even though they are always coming from the same path (in site packages).&amp;nbsp; I have never been able to get this to work outside of the special folder in site packages that Esri uses to load system tools.&amp;nbsp; But using the code above, it does seem to work well in 10.0 - 10.2, which is nice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other functions used above:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14059472317061988" jivemacro_uid="_14059472317061988" modifiedtitle="true"&gt;
&lt;P&gt;def _get_toolbox_path():&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import os.path&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return os.path.join(os.path.dirname(__file__), "ESRI", "TOOLBOXES", "Base Tools.pyt")&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14059472693441660" jivemacro_uid="_14059472693441660" modifiedtitle="true"&gt;
&lt;P&gt;def _get_composite_toolbox_path():&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import os.path&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return os.path.join(os.path.dirname(__file__), "ESRI", "TOOLBOXES", "Composite Tools.pyt")&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially there is an issue with the way/order in which PYT files are read in by the system, Esri already knows about it and is working on a fix, but in the meantime, this is the only way I know of to get interdependent PYT files to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 13:00:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/errors-importing-custom-tools-from-a-ptyhon/m-p/184481#M14209</guid>
      <dc:creator>ChristopherMoravec1</dc:creator>
      <dc:date>2014-07-21T13:00:33Z</dc:date>
    </item>
  </channel>
</rss>

