<?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: Debug Python Toolbox in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315059#M24499</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The toolbox is a couple thousand lines long, and calls a couple of other scripts as well, so I think it would be best if I could send it to you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Mar 2013 16:31:42 GMT</pubDate>
    <dc:creator>JamieKass</dc:creator>
    <dc:date>2013-03-14T16:31:42Z</dc:date>
    <item>
      <title>Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315053#M24493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I like the idea of Python Toolboxes, but I have to admit implementing them is not very easy.&amp;nbsp; I'm trying to add a simple toolbox (perhaps simple should be in quotes?) and get a dreaded big red x through the script.&amp;nbsp; According to the help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;A tool icon that has been replaced with an error icon (Invalid Script) indicates a failure in the tool. To see an explanation of the problem, right-click the toolbox and click Why. This opens a Python Errors dialog box, which provides the error type and line number. This will cover errors in the tool's __init__, getParameterInfo, or isLicensed methods.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, when I do this there is no "Why".&amp;nbsp; I can check the toolbox for syntax errors but there are none.&amp;nbsp; How can find out what is wrong with my code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I tried to search the forums, but no results are returned.&amp;nbsp; Am I missing the ability to search individual forums such as the python forum, or is that not implemented either?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any guidance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 14:07:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315053#M24493</guid>
      <dc:creator>DavidLamb</dc:creator>
      <dc:date>2012-10-23T14:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315054#M24494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;post a screen of your toolbox and a list of the parameters you specified for it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 18:10:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315054#M24494</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2012-10-23T18:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315055#M24495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response.&amp;nbsp; I figured out what was missing.&amp;nbsp; But if you have any recommendations for debugging Python Toolboxes, please pass those along.&amp;nbsp; Is the "Why" option available to you?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 14:11:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315055#M24495</guid>
      <dc:creator>DavidLamb</dc:creator>
      <dc:date>2012-10-24T14:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315056#M24496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FYI, the Why option is available through the ArcCatalog view rather than ArcToolbox.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2012 23:42:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315056#M24496</guid>
      <dc:creator>DavidLamb</dc:creator>
      <dc:date>2012-10-29T23:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315057#M24497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having the same problem. I get a big red X on my Toolbox, which means I am unable to open it and even view the potential errors within them. However, when I click "Check Syntax" I get "No Syntax Errors". What does this mean? If there are no syntax errors, what is the problem? If there is an error, why doesn't it tell me where it is? As a test, I added an error, and it was returned when I reclicked "Check Syntax". This seems in all respects to be a bug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2013 21:22:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315057#M24497</guid>
      <dc:creator>JamieKass</dc:creator>
      <dc:date>2013-03-13T21:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315058#M24498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am having the same problem. I get a big red X on my Toolbox, which means I am unable to open it and even view the potential errors within them. However, when I click "Check Syntax" I get "No Syntax Errors". What does this mean? If there are no syntax errors, what is the problem? If there is an error, why doesn't it tell me where it is? As a test, I added an error, and it was returned when I reclicked "Check Syntax". This seems in all respects to be a bug.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you post the toolbox? It does sound like a bug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2013 22:43:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315058#M24498</guid>
      <dc:creator>ChrisFox3</dc:creator>
      <dc:date>2013-03-13T22:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315059#M24499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The toolbox is a couple thousand lines long, and calls a couple of other scripts as well, so I think it would be best if I could send it to you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2013 16:31:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315059#M24499</guid>
      <dc:creator>JamieKass</dc:creator>
      <dc:date>2013-03-14T16:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315060#M24500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I too finally figured out the problem in my code. In my case, a return that was carelessly indented out of the function. To find this error, as both PyScripter and ArcCatalog failed to notify me (granted I could have debugged, but that would require running all of my code step by step), I found that by compiling my script, I was notified of the errors that escaped detection. So if you too are at a loss as to why your python toolbox is broken, please compile and check what's returned before you pull your hair out. You can force compile your script with the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import py_compile

py_compile.compile("mymodule.py")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:00:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315060#M24500</guid>
      <dc:creator>JamieKass</dc:creator>
      <dc:date>2021-12-11T15:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315061#M24501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I was using Spatial Analyst Supplemental toolbox few months back on 10.5 and when i upgraded to 10.6, the pyt toolbox now has a red x mark. Checking the syntax, it showed as attached&lt;IMG alt="SpatialAnalystSupplementalTools_pyt toolbox error" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/433531_2019-01-17_14h29_19.png" /&gt;. I have no python background so need help to debug this. thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 06:30:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315061#M24501</guid>
      <dc:creator>iskahenyo1</dc:creator>
      <dc:date>2019-01-17T06:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Debug Python Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315062#M24502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;interesting, your name doesn't match the name on the last line of the error message. is it a multiuser environment?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 18:04:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/debug-python-toolbox/m-p/315062#M24502</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-17T18:04:55Z</dc:date>
    </item>
  </channel>
</rss>

