<?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 Python script does not work in Idle 3.7 in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-does-not-work-in-idle-3-7/m-p/1243798#M63769</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We recently used ArcPro model builder to design a pretty simple script that truncates a feature classes, then pulls data from an Excel with Lat and Long fields, makes an XY Event Layer, then appends the results of the XY layer to the truncated feature class. This model ran successfully, and once we exported it to a Python script it runs successfully with Idle 2.7, but not with 3.7.&lt;/P&gt;&lt;P&gt;The failure occurs when trying to access the Excel file (I think), which is strange that an older version of Python can get there, but not the same version that the script was built in. Here is the error:&amp;nbsp;ERROR 000732: XY Table: Dataset &amp;lt;dataset&amp;gt; does not exist or is not supported&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the script:&amp;nbsp;&lt;BR /&gt;Failed to execute (MakeXYEventLayer)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size="2"&gt;# -*- coding: utf-8 -*-&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;"""&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Generated by ArcGIS ModelBuilder on : 2022-12-22 09:50:37&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;"""&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;import arcpy&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;def PORModel(): # POR_Model&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# To allow overwriting outputs change overwriteOutput option to True.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;arcpy.env.overwriteOutput = True&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;PORAddresses_ = "\\\\ep-netapp2\groups$\\Police\\Investigations\\POR\\PORAddresses.xls\\PORAddresses$"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;epgdb_POLICE_POR_Locations = "M:\\IT\\GIS Maps_Projects\\Police\\PORMapping\\..\\..\\..\\ConnectionStrings\\Police.sde\\epgdb.POLICE.POR_Locations"&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# Process: Make XY Event Layer (Make XY Event Layer) (management)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;PORAddresses_Layer = "PORAddresses$_Layer"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;arcpy.management.MakeXYEventLayer(table=PORAddresses_, in_x_field="Long", in_y_field="Lat", out_layer=PORAddresses_Layer, spatial_reference="GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision", in_z_field="")&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# Process: Truncate Table (Truncate Table) (management)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;epgdb_POLICE_POR_Locations_2_ = arcpy.management.TruncateTable(in_table=epgdb_POLICE_POR_Locations)[0]&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# Process: Append (Append) (management)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;epgdb_POLICE_POR_Locations_4_ = arcpy.management.Append(inputs=[PORAddresses_Layer], target=epgdb_POLICE_POR_Locations_2_, schema_type="NO_TEST", field_mapping="Name \"Name\" true true false 255 Text 0 0,First,#,PORAddresses$_Layer,Name,0,255;Address \"Address\" true true false 255 Text 0 0,First,#,PORAddresses$_Layer,Address,0,255;Level_Status \"Level Status\" true true false 255 Text 0 0,First,#,PORAddresses$_Layer,Level_Status,0,255;Case_Number \"Case Number\" true true false 255 Text 0 0,First,#,PORAddresses$_Layer,Case_Number,0,255;Lat \"Lat\" true true false 8 Double 8 38,First,#,PORAddresses$_Layer,Lat,-1,-1;Long \"Long\" true true false 8 Double 8 38,First,#,PORAddresses$_Layer,Long,-1,-1;DOB \"Date of Birth\" true true false 8 Date 0 0,First,#,PORAddresses$_Layer,DOB,-1,-1", subtype="")[0]&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;if __name__ == '__main__':&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# Global Environment settings&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;with arcpy.EnvManager(scratchWorkspace=r"M:\IT\GIS Maps_Projects\Police\PORMapping\PORMapping_Working.gdb", workspace=r"M:\IT\GIS Maps_Projects\Police\PORMapping\PORMapping_Working.gdb"):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;PORModel()&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;print ("Script Successful")&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The Excel is on a mapped network drive, which I've occasionally had trouble hitting with other scripts, but Idle 2.7 seems to access it correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;other notes: We also have Python 3.9 installed. Tried to run it with Idle3.9 and get the error&amp;nbsp;ModuleNotFoundError: No module named 'arcpy'&lt;/P&gt;&lt;P&gt;Ran AnalyzeToolsForPro and it output No Problems&lt;/P&gt;</description>
    <pubDate>Tue, 27 Dec 2022 15:36:37 GMT</pubDate>
    <dc:creator>ZachBodenner</dc:creator>
    <dc:date>2022-12-27T15:36:37Z</dc:date>
    <item>
      <title>Python script does not work in Idle 3.7</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-does-not-work-in-idle-3-7/m-p/1243798#M63769</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We recently used ArcPro model builder to design a pretty simple script that truncates a feature classes, then pulls data from an Excel with Lat and Long fields, makes an XY Event Layer, then appends the results of the XY layer to the truncated feature class. This model ran successfully, and once we exported it to a Python script it runs successfully with Idle 2.7, but not with 3.7.&lt;/P&gt;&lt;P&gt;The failure occurs when trying to access the Excel file (I think), which is strange that an older version of Python can get there, but not the same version that the script was built in. Here is the error:&amp;nbsp;ERROR 000732: XY Table: Dataset &amp;lt;dataset&amp;gt; does not exist or is not supported&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the script:&amp;nbsp;&lt;BR /&gt;Failed to execute (MakeXYEventLayer)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size="2"&gt;# -*- coding: utf-8 -*-&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;"""&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Generated by ArcGIS ModelBuilder on : 2022-12-22 09:50:37&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;"""&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;import arcpy&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;def PORModel(): # POR_Model&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# To allow overwriting outputs change overwriteOutput option to True.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;arcpy.env.overwriteOutput = True&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;PORAddresses_ = "\\\\ep-netapp2\groups$\\Police\\Investigations\\POR\\PORAddresses.xls\\PORAddresses$"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;epgdb_POLICE_POR_Locations = "M:\\IT\\GIS Maps_Projects\\Police\\PORMapping\\..\\..\\..\\ConnectionStrings\\Police.sde\\epgdb.POLICE.POR_Locations"&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# Process: Make XY Event Layer (Make XY Event Layer) (management)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;PORAddresses_Layer = "PORAddresses$_Layer"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;arcpy.management.MakeXYEventLayer(table=PORAddresses_, in_x_field="Long", in_y_field="Lat", out_layer=PORAddresses_Layer, spatial_reference="GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision", in_z_field="")&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# Process: Truncate Table (Truncate Table) (management)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;epgdb_POLICE_POR_Locations_2_ = arcpy.management.TruncateTable(in_table=epgdb_POLICE_POR_Locations)[0]&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# Process: Append (Append) (management)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;epgdb_POLICE_POR_Locations_4_ = arcpy.management.Append(inputs=[PORAddresses_Layer], target=epgdb_POLICE_POR_Locations_2_, schema_type="NO_TEST", field_mapping="Name \"Name\" true true false 255 Text 0 0,First,#,PORAddresses$_Layer,Name,0,255;Address \"Address\" true true false 255 Text 0 0,First,#,PORAddresses$_Layer,Address,0,255;Level_Status \"Level Status\" true true false 255 Text 0 0,First,#,PORAddresses$_Layer,Level_Status,0,255;Case_Number \"Case Number\" true true false 255 Text 0 0,First,#,PORAddresses$_Layer,Case_Number,0,255;Lat \"Lat\" true true false 8 Double 8 38,First,#,PORAddresses$_Layer,Lat,-1,-1;Long \"Long\" true true false 8 Double 8 38,First,#,PORAddresses$_Layer,Long,-1,-1;DOB \"Date of Birth\" true true false 8 Date 0 0,First,#,PORAddresses$_Layer,DOB,-1,-1", subtype="")[0]&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;if __name__ == '__main__':&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;# Global Environment settings&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;with arcpy.EnvManager(scratchWorkspace=r"M:\IT\GIS Maps_Projects\Police\PORMapping\PORMapping_Working.gdb", workspace=r"M:\IT\GIS Maps_Projects\Police\PORMapping\PORMapping_Working.gdb"):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;PORModel()&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;print ("Script Successful")&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The Excel is on a mapped network drive, which I've occasionally had trouble hitting with other scripts, but Idle 2.7 seems to access it correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;other notes: We also have Python 3.9 installed. Tried to run it with Idle3.9 and get the error&amp;nbsp;ModuleNotFoundError: No module named 'arcpy'&lt;/P&gt;&lt;P&gt;Ran AnalyzeToolsForPro and it output No Problems&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 15:36:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-script-does-not-work-in-idle-3-7/m-p/1243798#M63769</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2022-12-27T15:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Python script does not work in Idle 3.7</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-script-does-not-work-in-idle-3-7/m-p/1243862#M63782</link>
      <description>&lt;P&gt;Update: The machine running the script did not have the MS Access driver installed. I'm unclear why that would have not stopped Python 2.7 from completing the script, but it solved the 3.7 issue.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 19:57:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-script-does-not-work-in-idle-3-7/m-p/1243862#M63782</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2022-12-27T19:57:15Z</dc:date>
    </item>
  </channel>
</rss>

