<?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 ExecuteError: ERROR 000010: Geocode addresses failed. The table already exists. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1129644#M63373</link>
    <description>&lt;P&gt;Looking up the &lt;STRONG&gt;000010 &lt;/STRONG&gt;Error I don't see anything in connection to "The table already exists". I looked over everything in the one help doc I found and nothing therein seems to be relevant. &lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00001-00025-000010.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/2.8/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00001-00025-000010.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I've been testing this script for a week now and I haven't been hung up on this error. I set OverwriteOutput to True. I'm not using a shapefile anywhere. I'm saving to a GDB. If anyone has any pointers I'd appreciate it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, csv
from arcgis.gis import GIS
import os
portal = r"https://willcountygis.maps.arcgis.com/" #&amp;lt;--Can also reference a local portal
user = 'username'
password = 'password'
arcpy.SignInToPortal(portal,user,password) #&amp;lt;--use this if script is run outside Pro
gis = GIS('https://willcountygis.maps.arcgis.com', 'username', 'password')
arcpy.env.overwriteOutput = True

'''
1. Grab Waste Recycling Contractor Reporting Form (results from Survey123) feature service and export to table, then save in Default.gdb
'''
layer_name = "Waste Recycling Contractor Reporting Form"
defaultDB = r'\\pathto\Projects\Will County Green\WasteRecyclingReport\Default.gdb'
#Create feature class from input feature service. 
wasteRecyclingReportFS = arcpy.MakeFeatureLayer_management("https://services.arcgis.com/fGsbyIOAuxHnF97m/arcgis/rest/services/service_e42e606d08284c32bbefd94b6f18764a/FeatureServer/0",
layer_name)

print(f'Survey123 results being exported to table')
#export to table
arcpy.conversion.TableToTable(wasteRecyclingReportFS, defaultDB, 'wasteRecyclingReport')

'''
2. geocode the addresses with the ArcGIS World Geocoding Service
'''
#ArcGIS World Geocoding Service URL
locator = "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/ArcGIS World Geocoding Service"
#Locator parameters
fieldMap = ("'Address or Place' addy VISIBLE NONE;Address2 &amp;lt;None&amp;gt; VISIBLE NONE;Address3 &amp;lt;None&amp;gt; VISIBLE NONE;Neighborhood &amp;lt;None&amp;gt; VISIBLE NONE;City city VISIBLE NONE;County &amp;lt;None&amp;gt; VISIBLE NONE;State state VISIBLE NONE;ZIP zip VISIBLE NONE;ZIP4 &amp;lt;None&amp;gt; VISIBLE NONE;Country &amp;lt;None&amp;gt; VISIBLE NONE")
gcName = "wasteRecyclingReport_geocode"
#newly created table of survey data
in_table = os.path.join(defaultDB, "wasteRecyclingReport")
geocodeResult = os.path.join(defaultDB, gcName)

print(f'Geocoding table')
# perform geocode
arcpy.geocoding.GeocodeAddresses(in_table,locator,fieldMap, geocodeResult, "STATIC", None, "ROUTING_LOCATION", None, "ALL")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Print statements and error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;Survey123 results being exported to table
Geocoding table

---------------------------------------------------------------------------
ExecuteError                              Traceback (most recent call last)
In  [1]:
Line 44:    arcpy.geocoding.GeocodeAddresses(in_table,locator,fieldMap, geocodeResult, "STATIC", None, "ROUTING_LOCATION", None, "ALL")

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geocoding.py, in GeocodeAddresses:
Line 519:   raise e

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geocoding.py, in GeocodeAddresses:
Line 516:   retval = convertArcObjectToPythonObject(gp.GeocodeAddresses_geocoding(*gp_fixargs((in_table, address_locator, in_address_fields, out_feature_class, out_relationship_type, country, location_type, category, output_fields), True)))

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py, in &amp;lt;lambda&amp;gt;:
Line 512:   return lambda *args: val(*gp_fixargs(args, True))

ExecuteError: ERROR 000010: Geocode addresses failed.
The table already exists. [wasteRecyclingReport_geocode]
Failed to execute (GeocodeAddresses).

---------------------------------------------------------------------------&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT: &lt;/STRONG&gt;Just an observation, &lt;EM&gt;&lt;STRONG&gt;arcpy.conversion.TableToTable()&lt;/STRONG&gt;&lt;/EM&gt; doesn't have a problem with overwriting as you can see from the print statement. So, why is the geocoded table not overwriting?&lt;/P&gt;</description>
    <pubDate>Thu, 30 Dec 2021 16:13:57 GMT</pubDate>
    <dc:creator>JaredPilbeam2</dc:creator>
    <dc:date>2021-12-30T16:13:57Z</dc:date>
    <item>
      <title>ExecuteError: ERROR 000010: Geocode addresses failed. The table already exists.</title>
      <link>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1129644#M63373</link>
      <description>&lt;P&gt;Looking up the &lt;STRONG&gt;000010 &lt;/STRONG&gt;Error I don't see anything in connection to "The table already exists". I looked over everything in the one help doc I found and nothing therein seems to be relevant. &lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00001-00025-000010.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/2.8/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00001-00025-000010.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I've been testing this script for a week now and I haven't been hung up on this error. I set OverwriteOutput to True. I'm not using a shapefile anywhere. I'm saving to a GDB. If anyone has any pointers I'd appreciate it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, csv
from arcgis.gis import GIS
import os
portal = r"https://willcountygis.maps.arcgis.com/" #&amp;lt;--Can also reference a local portal
user = 'username'
password = 'password'
arcpy.SignInToPortal(portal,user,password) #&amp;lt;--use this if script is run outside Pro
gis = GIS('https://willcountygis.maps.arcgis.com', 'username', 'password')
arcpy.env.overwriteOutput = True

'''
1. Grab Waste Recycling Contractor Reporting Form (results from Survey123) feature service and export to table, then save in Default.gdb
'''
layer_name = "Waste Recycling Contractor Reporting Form"
defaultDB = r'\\pathto\Projects\Will County Green\WasteRecyclingReport\Default.gdb'
#Create feature class from input feature service. 
wasteRecyclingReportFS = arcpy.MakeFeatureLayer_management("https://services.arcgis.com/fGsbyIOAuxHnF97m/arcgis/rest/services/service_e42e606d08284c32bbefd94b6f18764a/FeatureServer/0",
layer_name)

print(f'Survey123 results being exported to table')
#export to table
arcpy.conversion.TableToTable(wasteRecyclingReportFS, defaultDB, 'wasteRecyclingReport')

'''
2. geocode the addresses with the ArcGIS World Geocoding Service
'''
#ArcGIS World Geocoding Service URL
locator = "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/ArcGIS World Geocoding Service"
#Locator parameters
fieldMap = ("'Address or Place' addy VISIBLE NONE;Address2 &amp;lt;None&amp;gt; VISIBLE NONE;Address3 &amp;lt;None&amp;gt; VISIBLE NONE;Neighborhood &amp;lt;None&amp;gt; VISIBLE NONE;City city VISIBLE NONE;County &amp;lt;None&amp;gt; VISIBLE NONE;State state VISIBLE NONE;ZIP zip VISIBLE NONE;ZIP4 &amp;lt;None&amp;gt; VISIBLE NONE;Country &amp;lt;None&amp;gt; VISIBLE NONE")
gcName = "wasteRecyclingReport_geocode"
#newly created table of survey data
in_table = os.path.join(defaultDB, "wasteRecyclingReport")
geocodeResult = os.path.join(defaultDB, gcName)

print(f'Geocoding table')
# perform geocode
arcpy.geocoding.GeocodeAddresses(in_table,locator,fieldMap, geocodeResult, "STATIC", None, "ROUTING_LOCATION", None, "ALL")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Print statements and error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;Survey123 results being exported to table
Geocoding table

---------------------------------------------------------------------------
ExecuteError                              Traceback (most recent call last)
In  [1]:
Line 44:    arcpy.geocoding.GeocodeAddresses(in_table,locator,fieldMap, geocodeResult, "STATIC", None, "ROUTING_LOCATION", None, "ALL")

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geocoding.py, in GeocodeAddresses:
Line 519:   raise e

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geocoding.py, in GeocodeAddresses:
Line 516:   retval = convertArcObjectToPythonObject(gp.GeocodeAddresses_geocoding(*gp_fixargs((in_table, address_locator, in_address_fields, out_feature_class, out_relationship_type, country, location_type, category, output_fields), True)))

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py, in &amp;lt;lambda&amp;gt;:
Line 512:   return lambda *args: val(*gp_fixargs(args, True))

ExecuteError: ERROR 000010: Geocode addresses failed.
The table already exists. [wasteRecyclingReport_geocode]
Failed to execute (GeocodeAddresses).

---------------------------------------------------------------------------&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT: &lt;/STRONG&gt;Just an observation, &lt;EM&gt;&lt;STRONG&gt;arcpy.conversion.TableToTable()&lt;/STRONG&gt;&lt;/EM&gt; doesn't have a problem with overwriting as you can see from the print statement. So, why is the geocoded table not overwriting?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 16:13:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1129644#M63373</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-12-30T16:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteError: ERROR 000010: Geocode addresses failed. The table already exists.</title>
      <link>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1129658#M63374</link>
      <description>&lt;P&gt;I don't have an example, but in my experience, this issue can stem from how the path is being passed.&lt;/P&gt;&lt;P&gt;Try to hard code the in_table and geocodeResult variables as a string (rather than path). Alternatively, try passing them as a string object rather than the path object using f-strings.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#newly created table of survey data
in_table = os.path.join(defaultDB, "wasteRecyclingReport")
geocodeResult = os.path.join(defaultDB, gcName)

print(f'Geocoding table')
# perform geocode
arcpy.geocoding.GeocodeAddresses(f'{in_table}',locator,fieldMap, f'{geocodeResult}', "STATIC", None, "ROUTING_LOCATION", None, "ALL")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 16:42:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1129658#M63374</guid>
      <dc:creator>JohnMiller7</dc:creator>
      <dc:date>2021-12-30T16:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteError: ERROR 000010: Geocode addresses failed. The table already exists.</title>
      <link>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1129663#M63375</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/431718"&gt;@JohnMiller7&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Very good to know, thanks. I put the full path for the &lt;EM&gt;&lt;STRONG&gt;in_table&lt;/STRONG&gt;&lt;/EM&gt; variable and it ran successfully.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;in_table = r'\\pathto\Projects\Will County Green\WasteRecyclingReport\Default.gdb\wasteRecyclingReport'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 17:02:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1129663#M63375</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-12-30T17:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteError: ERROR 000010: Geocode addresses failed. The table already exists.</title>
      <link>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1129754#M63379</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/431718"&gt;@JohnMiller7&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought it worked, but I think it only worked because I first removed the table from the FGDB before I ran the script. Once I ran it with that table existing in the FGDB I got the same error.&lt;/P&gt;&lt;P&gt;The way I finally got it to work was to first delete the table before I ran the geocode function.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;tables = arcpy.ListTables()
for table in tables:
    arcpy.Delete_management(table)[0]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Dec 2021 22:11:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1129754#M63379</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-12-30T22:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteError: ERROR 000010: Geocode addresses failed. The table already exists.</title>
      <link>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1376446#M69754</link>
      <description>&lt;P&gt;Thank you! Worked through a similar problem with my geocoding script and the f-strings helped solve the problem. I didn't use os.path.join for the input and output. I used r"X:\fullpath"&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 14:33:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executeerror-error-000010-geocode-addresses-failed/m-p/1376446#M69754</guid>
      <dc:creator>Luiiis903</dc:creator>
      <dc:date>2024-01-31T14:33:51Z</dc:date>
    </item>
  </channel>
</rss>

