<?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: arcpy.Geocode won't work inside script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284130#M21926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good catch. However, that bad syntax on my part has never caused me issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it also didn't solve this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Aug 2014 20:35:24 GMT</pubDate>
    <dc:creator>RobertChappe1</dc:creator>
    <dc:date>2014-08-14T20:35:24Z</dc:date>
    <item>
      <title>arcpy.Geocode won't work inside script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284128#M21924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Using ArcGIS 10.2.1 for Desktop on Windows 8.1&lt;/LI&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched through the forums and couldn't find a resolution to this, though people have experienced similar problems:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fairly simple script that will:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;take a user string input (an address)&lt;/LI&gt;&lt;LI&gt;create a temp table to store the address&lt;/LI&gt;&lt;LI&gt;geocode address&lt;/LI&gt;&lt;LI&gt;more processing planned&lt;/LI&gt;&lt;/OL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;running Geocode Addresses from the toolbox with the same inputs and &lt;STRONG&gt;it works&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;running the following piece of code from the python command line in arcmap&lt;STRONG&gt; work&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE class="python" name="code"&gt;arcpy.GeocodeAddresses_geocoding("C:/Users/v-robcha/Documents/ArcGIS/Default.gdb/GeocodeTemp","GIS Servers/geocoderfromESRI/World.GeocodeServer","SingleLine Address VISIBLE NONE","C:/Users/v-robcha/Documents/ArcGIS/Default.gdb/GeocodeTEMP_GeocodeAddresses_1","STATIC")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I try to use that EXACT line (hard coded file paths and all) in a script tool the geocoded results are empty. No matched or unmatched, just zero features. Furthermore, when I try to use variables for the file paths it returns the same result (nothing).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the full script, I am quite frustrated at this point.&lt;/P&gt;&lt;PRE class="python" name="code"&gt;# Import arcpy module import arcpy import csv import os arcpy.env.workspace = r"C:/Users/v-robcha/Documents/ArcGIS/Default.gdb" ws = arcpy.env.workspace #address to be geocoded&amp;nbsp; address = arcpy.GetParameterAsText(0) #geocode service geocoder = r"GIS Servers\geocoderfromESRI\World.GeocodeServer" # dbf template for geocoding dbftemplate = "TemplateGeocode" # geocode output fn GeocodeAddressOut = "GeocodeAddresses_please" # user parameter for facilities (hotels, avis, etc) ## set up list of choices ## FacilitiesLocations = "AvisLocations_All1" # create table to store user input address arcpy.CreateTable_management(ws,"GeocodeTemp",dbftemplate,"#") ifields = ["OBJECTID", "Address"] irow = ["0", address] icur = arcpy.da.InsertCursor("GeocodeTemp", ifields) icur.insertRow(irow) # Process: Geocode Addresses arcpy.GeocodeAddresses_geocoding("GeocodeTemp", geocoder, "SingleLine Address VISIBLE NONE", GeocodeAddressOut, "STATIC") &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 20:25:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284128#M21924</guid>
      <dc:creator>RobertChappe1</dc:creator>
      <dc:date>2014-08-14T20:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Geocode won't work inside script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284129#M21925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haven't looked in detail, however, you don't mix raw format with forward slashes in&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = r&lt;SPAN class="string"&gt;"C:/Users/v-robcha/Documents/ArcGIS/Default.gdb"&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;get rid of the "r" in the path&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 20:28:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284129#M21925</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-08-14T20:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Geocode won't work inside script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284130#M21926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good catch. However, that bad syntax on my part has never caused me issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it also didn't solve this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 20:35:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284130#M21926</guid>
      <dc:creator>RobertChappe1</dc:creator>
      <dc:date>2014-08-14T20:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Geocode won't work inside script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284131#M21927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still struggling. Any help would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 19:00:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284131#M21927</guid>
      <dc:creator>RobertChappe1</dc:creator>
      <dc:date>2014-08-19T19:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Geocode won't work inside script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284132#M21928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We're having the exact same problem.&amp;nbsp; Single Field Locator fails to match any addresses when run in python, but works fine when run in ArcMap.&amp;nbsp; Other Locators, like US Dual Range, work fine.&amp;nbsp; Went back to a machine with ArcGIS 10.1 installed and ran the script pointing to the same datasources and it works just fine.&amp;nbsp; Everything points to problems with the Single Field Locator being run as a python script outside ArcMap on a 10.2.1 client.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 20:36:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284132#M21928</guid>
      <dc:creator>KevinBrown2</dc:creator>
      <dc:date>2014-11-04T20:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Geocode won't work inside script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284133#M21929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A coworker of mine, &lt;A href="https://community.esri.com/migrated-users/5215"&gt;Darris Friend&lt;/A&gt;‌, found the problem.&amp;nbsp; We're using address points with the "General - Single Field" geocoder.&amp;nbsp; At 10.1 and earlier, the syntax for the python script was:&lt;/P&gt;&lt;P&gt;arcpy.GeocodeAddresses_geocoding({TableOfAddresses}, {GeocoderName}, "&lt;STRONG&gt;SingleKey&lt;/STRONG&gt; {AddressFieldName} VISIBLE NONE", etc...)&lt;/P&gt;&lt;P&gt;At 10.2 it's now:&lt;/P&gt;&lt;P&gt;arcpy.GeocodeAddresses_geocoding({TableOfAddresses}, {GeocoderName}, "&lt;STRONG&gt;'Single Line Input'&lt;/STRONG&gt; {AddressFieldName} VISIBLE NONE", etc...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So SingleKey changed to 'Single Line Input'.&amp;nbsp; Make sure you include the single quotes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 14:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284133#M21929</guid>
      <dc:creator>KevinBrown2</dc:creator>
      <dc:date>2014-11-10T14:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Geocode won't work inside script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284134#M21930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After trying a lot of different 'solutions' to the generic Error 000010 that the geocoder throws when following the examples in the documentation, this one provided by&amp;nbsp;@brownkj worked: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GeocodeAddresses_geocoding&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;permittable&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; geocoder&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"'Single Line Input' ADDRESS VISIBLE NONE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outFC&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With over &lt;SPAN class=""&gt;5177 Views at the time of writing this (~862 a year, 2.3 times a day since the original posting), I'm resurrecting this solution to tag Error 000010 so hopefully it helps others find a solution a lot faster than I did.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2020 17:22:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-geocode-won-t-work-inside-script/m-p/284134#M21930</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-08T17:22:47Z</dc:date>
    </item>
  </channel>
</rss>

