<?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: 'NoneType' object when calling a toolbox method problem in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/nonetype-object-when-calling-a-toolbox-method/m-p/722986#M55994</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter, I don't have experience with adding toolboxes in that way, but it seems like it's saying that arcpy is a None (null) value, or NoneType object.&amp;nbsp; Where a layer object has attributes like .visible or .isGroupLayer, a NoneType object does not have an attribute .&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;AddLayerToMXD_jtools.&amp;nbsp; So it seems like there's something weird with the way you're referring to arcpy...&amp;nbsp; Maybe in part of the script that's not shown?&amp;nbsp; Try printing arcpy, or help(arcpy) just before you call that custom function to see what happens.&amp;nbsp; Hope this is helpful...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Aug 2014 14:57:32 GMT</pubDate>
    <dc:creator>AdamCox1</dc:creator>
    <dc:date>2014-08-12T14:57:32Z</dc:date>
    <item>
      <title>'NoneType' object when calling a toolbox method problem</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-when-calling-a-toolbox-method/m-p/722985#M55993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello - We are using ArcGIS 10 and Python 2.6.&amp;nbsp; I have a Python script tool where I would like to call a custom-built tool.&amp;nbsp; In my tool script I import my toolbox if it has not already been imported (I check the arcpy.ListToolboxes()). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if "AddLayerToolbox" not in arcpy.ListToolboxes():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ImportToolbox([path to toolbox])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then make the following call as debug:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.AddMessage(inspect.getargspec(arcpy.AddLayerToMXD_jtools))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That prints out the arguments to that tool correctly so I assume that arcpy knows about that tool now. Then I call the tool via:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.AddLayerToMXD_jtools(param1, param2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With that call, I get the error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error: 'NoneType' object has no attribute 'AddLayerToMXD_jtools'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what this really means since.&amp;nbsp; It isn't an issue with the parameter values because that would come back with a different error.&amp;nbsp; This is indicating that it can't find that tool, although I used that tool in the preceding call to print out the tool's arguments.&amp;nbsp; I tried running a test where I used one of the standard ArcGIS Toolbox methods and that seemed to run fie.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts on what I am missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks - Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2014 19:28:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-when-calling-a-toolbox-method/m-p/722985#M55993</guid>
      <dc:creator>PeterLen</dc:creator>
      <dc:date>2014-08-11T19:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: 'NoneType' object when calling a toolbox method problem</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-when-calling-a-toolbox-method/m-p/722986#M55994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter, I don't have experience with adding toolboxes in that way, but it seems like it's saying that arcpy is a None (null) value, or NoneType object.&amp;nbsp; Where a layer object has attributes like .visible or .isGroupLayer, a NoneType object does not have an attribute .&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;AddLayerToMXD_jtools.&amp;nbsp; So it seems like there's something weird with the way you're referring to arcpy...&amp;nbsp; Maybe in part of the script that's not shown?&amp;nbsp; Try printing arcpy, or help(arcpy) just before you call that custom function to see what happens.&amp;nbsp; Hope this is helpful...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 14:57:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-when-calling-a-toolbox-method/m-p/722986#M55994</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2014-08-12T14:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: 'NoneType' object when calling a toolbox method problem</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-when-calling-a-toolbox-method/m-p/722987#M55995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I had a problem importing a python toolbox (downloaded from ESRI) from a script using the arcpy.Importbox command and ended up getting an ESRI tech or two working on the problem.&amp;nbsp; It turned out that I could not import any python toolboxes from a script, though they worked fine from the desktop. I had 64 bit python installed by default in our setup so we could use 64 bit geoprocessing but the custom python tool boxes required 32 bit python.&amp;nbsp; When I ran my same script using 32 bit python, it imported the toolbox just fine and the script ran without incident.&lt;/P&gt;&lt;P&gt;Patti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 23:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-when-calling-a-toolbox-method/m-p/722987#M55995</guid>
      <dc:creator>PattiHaggerty</dc:creator>
      <dc:date>2014-09-11T23:13:20Z</dc:date>
    </item>
  </channel>
</rss>

