<?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: Python Script Works in IDLE but Fails in Pro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272957#M11917</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't mean to state the obvious but Idle 2.7.13 is Python 2.7 from ArcGIS Desktop and Idle (ArcGIS Pro) uses Python 3.6.5., two stated incompatible versions of Python.&lt;BR /&gt;&lt;BR /&gt;Analyze Tools for Pro is a surface level tool. It does not work so well on complex scripts. Has a success rate about on par with 2to3 (not great) and doesn't patch most scripts well enough to create any semblance of true interoperability between Py 2 and Py3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my case, re-writing the code by hand after debugging did the trick for errors similar to yours. Found that I had to implement a bunch of try and except statements to get around incompatibilities between 2 and 3 that don't get caught by "Analyze Tools for Pro"&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Dec 2018 01:29:41 GMT</pubDate>
    <dc:creator>ErikLash1</dc:creator>
    <dc:date>2018-12-29T01:29:41Z</dc:date>
    <item>
      <title>Python Script Works in IDLE but Fails in Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272956#M11916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been dealing with this issue for a couple of months. I have a Python script that converts CAD files to Geodatabase feature classes for nearly 100 facilities. The script runs flawlessly every time in IDLE 2.7.13. When I run the script in a toolbox in ArcGIS Pro 2.2.4,&amp;nbsp;at least half the time the script fails at some point. It's usually on the tools&amp;nbsp;&lt;STRONG&gt;arcpy.AddField_management (error 000852)&lt;/STRONG&gt;&amp;nbsp;or&lt;STRONG&gt; arcpy.Merge_management (error000735) .&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;When the script does run to completion in Pro, the resulting feature classes are different from those generated by the standalone script. There are many null features, and/or data is copied from one DWG record to dozens of other features. I believe these errors are caused by record IDs not being correctly copied from a room report CSV using the&amp;nbsp;&lt;STRONG&gt;&amp;nbsp; arcpy.TableToTable_conversion&amp;nbsp;&lt;/STRONG&gt;tool.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've made sure the script is Python 3 compatible and run the &lt;STRONG&gt;Analyze Tools for Pro&lt;/STRONG&gt; tool with no errors. The only differences between the two versions of the script are &lt;STRONG&gt;arcpy.AddMessage&amp;nbsp;&lt;/STRONG&gt;functions in place of "print" and hardcoded paths in the standalone version versus&amp;nbsp;&lt;STRONG&gt;arcpy.GetParameterAsText&amp;nbsp;&lt;/STRONG&gt;parameters&amp;nbsp;in the ArcGIS Pro toolbox.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is anyone else having these kinds of problems with ArcGIS Pro?&amp;nbsp;I'm OK with using the standalone script, but I want others to be able to use the tool in Pro.&amp;nbsp;One&amp;nbsp;hypothesis I have is that&amp;nbsp;the script could be&amp;nbsp;failing because ArcGIS Pro is open during the process, possibly due to memory errors. A few times when I have run the standalone script with Pro open and tried to refresh the geodatabase, the standalone script will error out.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2018 17:46:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272956#M11916</guid>
      <dc:creator>deleted-user-1_r2dgYuILKY</dc:creator>
      <dc:date>2018-12-28T17:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Works in IDLE but Fails in Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272957#M11917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't mean to state the obvious but Idle 2.7.13 is Python 2.7 from ArcGIS Desktop and Idle (ArcGIS Pro) uses Python 3.6.5., two stated incompatible versions of Python.&lt;BR /&gt;&lt;BR /&gt;Analyze Tools for Pro is a surface level tool. It does not work so well on complex scripts. Has a success rate about on par with 2to3 (not great) and doesn't patch most scripts well enough to create any semblance of true interoperability between Py 2 and Py3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my case, re-writing the code by hand after debugging did the trick for errors similar to yours. Found that I had to implement a bunch of try and except statements to get around incompatibilities between 2 and 3 that don't get caught by "Analyze Tools for Pro"&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Dec 2018 01:29:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272957#M11917</guid>
      <dc:creator>ErikLash1</dc:creator>
      <dc:date>2018-12-29T01:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Works in IDLE but Fails in Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272958#M11918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right. Hopefully ESRI will work on making that "Pro" tool more than a useless surface level thing. I won't hold my breath. This script was developed by my predecessor as an ArcMap 10.5 toolbox before anybody had installed Pro. I've been trying to port it over with limited success.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll add try/except statements and see if that helps. Honestly I could care less about running this in a toolbox in Pro, but I need to be able to make it accessible to other people in my organization. I've always found it better to run Python scripts that use arcpy from IDLE or the command line instead of inside ArcMap.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Dec 2018 18:15:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272958#M11918</guid>
      <dc:creator>deleted-user-1_r2dgYuILKY</dc:creator>
      <dc:date>2018-12-31T18:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Works in IDLE but Fails in Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272959#M11919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Analyze Tools For Pro runs Python2to3 to determine syntax updates to make, and this is the best available automated method from the Python community to see the changes required to run code written for Python 2 in Python 3.&amp;nbsp;Analyze Tools For Pro also performs&amp;nbsp;simple checks for arcpy functions or modules that are not available in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;These two checks have been very successful in getting many scripts written for ArcMap to work in ArcGIS Pro, but additional things not captured by the tool could definitely be encountered. However, we haven't heard about anything specific through tech support or other forum posts.&lt;/P&gt;&lt;P&gt;If there are specific things you have found that require try excepts to get it to work in ArcMap and Pro, please post it here and the Python experts can evaluate and give feedback (and we can potentially integrate such logic into the Analyze tool).&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Drew&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2019 20:31:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272959#M11919</guid>
      <dc:creator>DrewFlater</dc:creator>
      <dc:date>2019-01-02T20:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Works in IDLE but Fails in Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272960#M11920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regarding problems with AddField, Merge, or TableToTable when running the script from Pro, would it be possible for you to get in touch with tech support on this problem? It sounds like a severe bug that we'd like to have analyzed by tech support and sent to development to fix the issue. You could also post the failing script and some sample data here if you have a set of steps that consistently shows the problem. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2019 20:33:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272960#M11920</guid>
      <dc:creator>DrewFlater</dc:creator>
      <dc:date>2019-01-02T20:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Works in IDLE but Fails in Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272961#M11921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So after sharing this with tech support it turns out that this is indeed a bug in ArcGIS Pro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12.0pt; "&gt;BUG-000120032:&amp;nbsp;ArcGIS Pro does not recognize XREF layer in the AutoCAD file&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2019 22:37:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-script-works-in-idle-but-fails-in-pro/m-p/272961#M11921</guid>
      <dc:creator>deleted-user-1_r2dgYuILKY</dc:creator>
      <dc:date>2019-02-12T22:37:25Z</dc:date>
    </item>
  </channel>
</rss>

