I have a script I am attempting to debug so I can automate this task I have to do a weekly basis every monday morning which is tedious. I am very new to python and coding in general.
This is a very simple script, I am given a excel sheet with data (addresses) and I have to geocode them. I then must clip out the points to only a specific area (polygon) and then I select a specific 'series' which is a field type for its attribute and have that become its own layer so I can manipulate its symbology uniquely. Below is my script.
All the paths are correct however the "Y" drive is a network drive shared between the entire organization. When I first came across this error my table was located there so I moved it locally on my desktop and the error persists.
The table is not open or being used by any other program by myself or anyone else so there should not be a file lock on it.
Anyone have any suggestions?
My code is below.
# Import arcpy module import arcpy import os #Change user "jhead" to your local group username (amiller), this creates a temp folder on your desktop #because the path for geocoding will not save outputbecause of spaces in path newpath = r'C:\Users\jhead\Desktop\Temp' if not os.path.exists(newpath): os.makedirs(newpath) # Local variables: Sheet1_ = "Sheet1$" LakeWorth_Addressing_Parcels = "Y:\\Department for Community Sustainability\\GIS Division\\Internal Division Files\\GIS Addressing Tools\\LakeWorth_Addressing_Parcels" table1_xlsx = "C:\Users\jhead\Desktop\table1.xlsx" Geocode1_shp = "Y:\\Department for Community Sustainability\\GIS Division\\Internal Division Files\\Division Work Folders\\ABT\\New_project\\TempData\\Geocode1.shp" LakeWorth_DBO_Municipal_Boundary_Poly_2016 = "LakeWorth.DBO.Municipal_Boundary_Poly_2016" clip1_shp = "Y:\\Department for Community Sustainability\\GIS Division\\Internal Division Files\\Division Work Folders\\ABT\\New_project\\TempData\\clip1.shp" liquor_select_shp = "Y:\\Department for Community Sustainability\\GIS Division\\Internal Division Files\\Division Work Folders\\ABT\\New_project\\TempData\\liquor_select.shp" # Process: Geocode Addresses arcpy.GeocodeAddresses_geocoding(Sheet1_, LakeWorth_Addressing_Parcels, "Street ADDRESS_LINE1 VISIBLE NONE;City City VISIBLE NONE;ZIP ZIP VISIBLE NONE", Geocode1_shp, "STATIC") # Process: Clip arcpy.Clip_analysis(Geocode1_shp, LakeWorth_DBO_Municipal_Boundary_Poly_2016, clip1_shp, "") # Process: Select arcpy.Select_analysis(clip1_shp, liquor_select_shp, "\"SERIES\" = '3PS'")
The error I am recieving is: **
- Runtime error Traceback (most recent call last): File "", line 29, in File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geocoding.py", line 212, in GeocodeAddresses raise e ExecuteError: ERROR 000006: Could not open the address table. Failed to execute (GeocodeAddresses).
** I would like to add that when I perform this tool manually (toolbox and select the tool and add the inputs manually) everything works perfectly. it grabs the tables and geocodes all the addresses no issues. So not sure why this is happening.
I think maybe its due to this geocode tool having multiple inputs, sheet, the table and the addressing locator, but in the script its missing the table inut and the model shows a dotted line connected rather solid line.