I am trying to automate rebuilding address locators with a Python script.
I am able to successfully rebuild the address locators manually in ArcGIS Pro with the Rebuild Address Locator geoprocessing tool.
But I continually get "Error 000005: Could not open the address locator" when trying to rebuild them with the script. I've run out of ideas of things to check.
In the documentation for Error 000005, it says:
"This error can occur for one of the following reasons:
- A locator built with the Create Locator tool is the input to the Rebuild Address Locator tool and the reference data for the locator is stored in an enterprise geodatabase or is not accessible."
Does this mean that, if you use those tools, the locator cannot use data from an enterprise geodatabase? It would be super helpful if someone could confirm that for me. I feel like that is what the documentation says, but I just find that hard to believe, because it seems like most people would be using data from an enterprise gdb!! I am.
Here are the relevant parts of my script - can you see anything that should be changed??
import arcpy
arcpy.env.workspace = r'D:\MyFolder\Locators'
arcpy.geocoding.RebuildAddressLocator(r"D:\MyFolder\Locators\MY_LOCATOR")
# I also tried the above line with only the locator name as the argument ("MY_LOCATOR")
Thank you!