I'm trying to geocode a csv file in an ArcGIS Pro Jupyter notebook, using our Street Map Premium locator. No matter what I do, it returns 'RunTimeError: Object: Error in executing tool'. I'm following the ESRI documentation here. I have an SMP license.
I don't really understand the sample field map at "\'Address or Place\' Address" or "ZIP ZIP <None>", since that doesn't follow the pattern of the rest of the fields. I've also tried adding the field names from the csv - address1, address2, city, state, zip - in the <None> spots, but it doesn't appear to make a difference.
Any ideas on what's going wrong? Thanks.
# Geocode csv
cwd = Path(os.getcwd())
csv_path = cwd / r"Data\Recruitment_2026-06-23.csv"
smp_locator = r'<path to locator>\My_2026_Q1.loc'
output_fc = cwd / r'Recruitment'
field_map = ("\'Address or Place\' Address VISIBLE NONE;Address2 <None> VISIBLE NONE;Address3 <None> VISIBLE NONE;" +
"Neighborhood <None> VISIBLE NONE;City <None> VISIBLE NONE;Subregion <None> VISIBLE NONE;" +
"Region <None> VISIBLE NONE;ZIP ZIP <None> VISIBLE NONE;ZIP4 <None> VISIBLE NONE;" +
"Country <None> VISIBLE NONE")
try:
# Error occurs here
arcpy.geocoding.GeocodeAddresses(csv_path, smp_locator, field_map, output_fc)
except RuntimeError as e:
import traceback
print(f"Exception message: {str(e)}")
error_stack = traceback.format_exc()
print(error_stack)
else:
print(f"Geocoding complete: {output_fc}")
The issue might be the extra "<None>" in your field mapping. for example, Address2 <None> VISIBLE NONE, ZIP ZIP <None> VISIBLE NONE, I think it should be ZIP ZIP VISIBLE NONE, etc.