<?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: Geocode Addresses Runs Fine in Pro But Fails With arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/geocode-addresses-runs-fine-in-pro-but-fails-with/m-p/1137104#M63579</link>
    <description>&lt;P&gt;Can you try adding print statements to see if your variables for paths are populating correctly?&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jan 2022 21:10:47 GMT</pubDate>
    <dc:creator>MichaelVolz</dc:creator>
    <dc:date>2022-01-25T21:10:47Z</dc:date>
    <item>
      <title>Geocode Addresses Runs Fine in Pro But Fails With arcpy</title>
      <link>https://community.esri.com/t5/python-questions/geocode-addresses-runs-fine-in-pro-but-fails-with/m-p/1137051#M63577</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I've been attempting to automate geocoding our address points to our street centerlines to tie some of the attribution together.&lt;/P&gt;&lt;P&gt;I have Geocoder setup that works fine in Pro (screenshot of it successfully running attached), but crashes when called via a Python script using the same parameters and running on the same machine.&amp;nbsp; Any thoughts as to why I'm getting this behavior?&lt;BR /&gt;&lt;BR /&gt;I'm running ArcGIS Pro 2.8.2.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcpy.geocoding import GeocodeAddresses
field_map = "'FULLADD' SingleLine VISIBLE NONE"
GeocodeAddresses(f"{GDB_PATH}/AddressToGeocode3",
                 ADDR_LOC,
                 field_map,
                 f"{GDB_PATH}/AddressToGeocode3_GeocodeAdd8")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GDB_PATH&lt;/STRONG&gt; is the same path used by my Pro project&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ADDR_LOC&lt;/STRONG&gt; is the same locator path used in the Pro project&lt;/P&gt;&lt;P&gt;Here is the error message returned:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Traceback (most recent call last):
  File "&amp;lt;pyshell#8&amp;gt;", line 4, in &amp;lt;module&amp;gt;
    r"G:\GIS2\Staff\MikeM\Projects\SDE Maintenance\SDE Maintenance.gdb\AddressToGeocode3_GeocodeAdd8")
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geocoding.py", line 519, in GeocodeAddresses
    raise e
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geocoding.py", line 516, in GeocodeAddresses
    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", line 512, in &amp;lt;lambda&amp;gt;
    return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: ERROR 000010: Geocode addresses failed.
Failed to execute (GeocodeAddresses).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 19:44:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geocode-addresses-runs-fine-in-pro-but-fails-with/m-p/1137051#M63577</guid>
      <dc:creator>MichaelMorisette</dc:creator>
      <dc:date>2022-01-25T19:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Geocode Addresses Runs Fine in Pro But Fails With arcpy</title>
      <link>https://community.esri.com/t5/python-questions/geocode-addresses-runs-fine-in-pro-but-fails-with/m-p/1137083#M63578</link>
      <description>&lt;P&gt;Check if a similar script works for you? Please define full pathnames, wherever required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

arcpy.env.workspace = r"C:\Geocoding\locator\addresses.gdb" #Path of default geodatabase where the table and output FC is stored

# Set local variables
table = "AddressToGeocode3"
locator = r"C:\Geocoding\locator\AddressToCenterline.loc" #Full pathname of locator
field_map = "'FULLADD' SingleLine VISIBLE NONE"
geocode_result = "AddressToGeocode3_GeocodeAdd7"

arcpy.GeocodeAddresses_geocoding(table, locator, 
                                 field_map, geocode_result)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume the locator file is saved in a basic folder, in which case you could define the full pathname of the locator file.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 20:28:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geocode-addresses-runs-fine-in-pro-but-fails-with/m-p/1137083#M63578</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2022-01-25T20:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Geocode Addresses Runs Fine in Pro But Fails With arcpy</title>
      <link>https://community.esri.com/t5/python-questions/geocode-addresses-runs-fine-in-pro-but-fails-with/m-p/1137104#M63579</link>
      <description>&lt;P&gt;Can you try adding print statements to see if your variables for paths are populating correctly?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 21:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geocode-addresses-runs-fine-in-pro-but-fails-with/m-p/1137104#M63579</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2022-01-25T21:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Geocode Addresses Runs Fine in Pro But Fails With arcpy</title>
      <link>https://community.esri.com/t5/python-questions/geocode-addresses-runs-fine-in-pro-but-fails-with/m-p/1137111#M63580</link>
      <description>&lt;P&gt;For what its worth don't mix f-strings with unix path formation, use&lt;STRONG&gt; rf-strings&lt;/STRONG&gt; to make sure you get the correct path formation.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gdb_path = r"G:\GIS2\Staff\MikeM\Projects\SDE Maintenance\SDE Maintenance.gdb"
z = f"{gdb_path}/AddressToGeocode3"
z1 = f"{gdb_path}/AddressToGeocode3_GeocodeAdd8"

z
'G:\\GIS2\\Staff\\MikeM\\Projects\\SDE Maintenance\\SDE Maintenance.gdb/AddressToGeocode3'
z1
'G:\\GIS2\\Staff\\MikeM\\Projects\\SDE Maintenance\\SDE Maintenance.gdb/AddressToGeocode3_GeocodeAdd8'

z = rf"{gdb_path}\AddressToGeocode3"
z1 = rf"{gdb_path}\AddressToGeocode3_GeocodeAdd8"

z
'G:\\GIS2\\Staff\\MikeM\\Projects\\SDE Maintenance\\SDE Maintenance.gdb\\AddressToGeocode3'
z1
'G:\\GIS2\\Staff\\MikeM\\Projects\\SDE Maintenance\\SDE Maintenance.gdb\\AddressToGeocode3_GeocodeAdd8'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 21:24:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geocode-addresses-runs-fine-in-pro-but-fails-with/m-p/1137111#M63580</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-25T21:24:48Z</dc:date>
    </item>
  </channel>
</rss>

