<?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: OSError: &amp;quot;[list of filenames]&amp;quot; does not exist in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71785#M5912</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua, thanks for your quick response - It was indeed an issue with calling the list of tables instead of a single table. After updating the line, I no longer have the OSError, but am now having the following error:&amp;nbsp;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;"NameError&lt;/SPAN&gt;: name 'f' is not defined".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was my understanding that 'f' is just the iterator variable for the list of fieldnames, and does not need to be defined before being called. Sorry for the really simple questions, I'm new to arcpy so it's probably another beginner error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2020 17:26:00 GMT</pubDate>
    <dc:creator>jblng</dc:creator>
    <dc:date>2020-07-28T17:26:00Z</dc:date>
    <item>
      <title>OSError: "[list of filenames]" does not exist</title>
      <link>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71783#M5910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apologies in advance if this is a duplicate question. &lt;A _jive_internal="true" href="https://community.esri.com/thread/215092-file-doesnt-exist-exception-on-arcpylistfields" target="_blank"&gt;This question&lt;/A&gt;&amp;nbsp;seems to be slightly similar, but I think mine is more basic. I am trying to run a simple for loop in jupyter notebooks to iterate through tables in a gdb with arcpy.AlterField_management and update non-required field names with the name of the table.&amp;nbsp;However, when running this operation I get an OSError: "[list of filenames]" does not exist. I got the same error when running the script in an arcgis toolbox. My code and the error message are below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I saw in &lt;A href="https://gis.stackexchange.com/questions/310687/for-loop-can-not-find-the-next-raster-object-in-the-geodatabase-oserror-doe?answertab=votes#tab-top" rel="nofollow noopener noreferrer" target="_blank"&gt;this stack overflow question&lt;/A&gt; that it might be an issue with my arcpy site package, but I don't know how to rectify if that were the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Jo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;------&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding: 0px 0.4em;"&gt;import arcpy, os, sys&lt;BR /&gt;from arcpy import env&lt;P&gt;&lt;/P&gt;arcpy.env.overwriteOutput = True&lt;P&gt;&lt;/P&gt;# Set the workspace directory - make sure it's the copied gdb and not the original, in case you mess up&lt;BR /&gt;arcpy.env.workspace = r"P:\AFG\GEO\Team\Projects\Shock_Vulnerability\NTL\NTL_201801_202001_AFG_proj_zonalst_copy.gdb"&lt;P&gt;&lt;/P&gt;# Get the list of the zonal stats tables to process&lt;BR /&gt;tables = arcpy.ListTables(wild_card="*AFG_proj_zonalst", table_type="ALL")&lt;BR /&gt;print (tables)&lt;P&gt;&lt;/P&gt;# iterate through the tables in the gdb and update field names with the file names&lt;BR /&gt;for table in tables: &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print ("processing: " + table)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# print field names&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# iterate through field names in table&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for fname in [f.name for f in arcpy.ListFields(tables, wild_card="", field_type="ALL") if not f.required]:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print(fname) &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AlterField_management(table, f.name, f.name+"_%Name%")&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print(fname)&lt;/DIV&gt;&lt;DIV class="" style="padding: 0px 0.4em;"&gt;-------&lt;/DIV&gt;&lt;DIV class="" style="padding: 0px 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;['NTL_QN_202001_AFG_proj_zonalst', 'NTL_201912_AFG_proj_zonalst', 'NTL_201911_AFG_proj_zonalst', 
'NTL_201910_AFG_proj_zonalst', 'NTL_201909_AFG_proj_zonalst', 'NTL_201908_AFG_proj_zonalst', 
'NTL_201907_AFG_proj_zonalst', 'NTL_201906_AFG_proj_zonalst', 'NTL_201905_AFG_proj_zonalst', 
'NTL_201904_AFG_proj_zonalst', 'NTL_201903_AFG_proj_zonalst', 'NTL_201902_AFG_proj_zonalst', 
'NTL_201901_AFG_proj_zonalst', 'NTL_201812_AFG_proj_zonalst', 'NTL_201811_AFG_proj_zonalst', 
'NTL_201810_AFG_proj_zonalst', 'NTL_201809_AFG_proj_zonalst', 'NTL_201808_AFG_proj_zonalst', 
'NTL_201807_AFG_proj_zonalst', 'NTL_201804_AFG_proj_zonalst', 'NTL_201801_AFG_proj_zonalst', 
'NTL_201806_AFG_proj_zonalst', 'NTL_201802_AFG_proj_zonalst', 'NTL_201805_AFG_proj_zonalst', 
'NTL_201803_AFG_proj_zonalst', 'NTL_202001_AFG_proj_zonalst'] processing: NTL_QN_202001_AFG_proj_zonalst&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;OSError&lt;/SPAN&gt;             
Traceback (most recent call last)&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;&amp;lt;ipython-input-14-596e9c744258&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     
16&lt;/SPAN&gt;     &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;# print field names&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     
17&lt;/SPAN&gt;     &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;# iterate through field names in table
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;---&amp;gt; 18&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;     &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;for&lt;/SPAN&gt; fname &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;in&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;f&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;tables&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; wild_card&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;""&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; field_type&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;not&lt;/SPAN&gt; f&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;required&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     
19&lt;/SPAN&gt;             print&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;fname&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     
20&lt;/SPAN&gt;             arcpy&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;AlterField_management&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"_%Name%"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;ListFields&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(dataset, wild_card, field_type)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   
1131&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;   
1132&lt;/SPAN&gt;         * String:   Only field types of String are returned."""
&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;-&amp;gt; 1133&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;     &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;return&lt;/SPAN&gt; gp&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;listFields&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;dataset&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; wild_card&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; field_type&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   
1134&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;   
1135&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;@&lt;/SPAN&gt;_gptooldoc&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"FeatureLayer"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"Table"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"TableView"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"Dataset"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"FeatureDataset"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;""&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;""&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;""&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;listFields&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, *args)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    
346&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;arcobjects&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;arcobjectconversion &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;import&lt;/SPAN&gt; convertArcObjectToPythonObject&lt;SPAN class="" style="color: #00a250;"&gt;    
347&lt;/SPAN&gt;         return convertArcObjectToPythonObject(
&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 348&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;                     self._gp.ListFields(*gp_fixargs(args, True)))&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    
349&lt;/SPAN&gt;     &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;def&lt;/SPAN&gt; listIndexes&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;*&lt;/SPAN&gt;args&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    
350&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"""GP function ListIndexes"""
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;OSError&lt;/SPAN&gt;: "['NTL_QN_202001_AFG_proj_zonalst', 'NTL_201912_AFG_proj_zonalst', 
'NTL_201911_AFG_proj_zonalst', 'NTL_201910_AFG_proj_zonalst', 'NTL_201909_AFG_proj_zonalst', 'NTL_201908_AFG_proj_zonalst',
'NTL_201907_AFG_proj_zonalst', 'NTL_201906_AFG_proj_zonalst', 'NTL_201905_AFG_proj_zonalst', 'NTL_201904_AFG_proj_zonalst', 
'NTL_201903_AFG_proj_zonalst', 'NTL_201902_AFG_proj_zonalst', 'NTL_201901_AFG_proj_zonalst', 'NTL_201812_AFG_proj_zonalst', 
'NTL_201811_AFG_proj_zonalst', 'NTL_201810_AFG_proj_zonalst', 'NTL_201809_AFG_proj_zonalst', 'NTL_201808_AFG_proj_zonalst', 
'NTL_201807_AFG_proj_zonalst', 'NTL_201804_AFG_proj_zonalst', 'NTL_201801_AFG_proj_zonalst', 'NTL_201806_AFG_proj_zonalst', 
'NTL_201802_AFG_proj_zonalst', 'NTL_201805_AFG_proj_zonalst', 'NTL_201803_AFG_proj_zonalst', 'NTL_202001_AFG_proj_zonalst']" does not exist&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:46:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71783#M5910</guid>
      <dc:creator>jblng</dc:creator>
      <dc:date>2021-12-10T22:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: OSError: "%filename%" does not exist</title>
      <link>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71784#M5911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would start by passing the table from the loop and not the list of tables to ListFields, i.e., use the following line instead of yours:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; fname &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; wild_card&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;required&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 15:25:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71784#M5911</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-07-28T15:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: OSError: "[list of filenames]" does not exist</title>
      <link>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71785#M5912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua, thanks for your quick response - It was indeed an issue with calling the list of tables instead of a single table. After updating the line, I no longer have the OSError, but am now having the following error:&amp;nbsp;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;"NameError&lt;/SPAN&gt;: name 'f' is not defined".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was my understanding that 'f' is just the iterator variable for the list of fieldnames, and does not need to be defined before being called. Sorry for the really simple questions, I'm new to arcpy so it's probably another beginner error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 17:26:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71785#M5912</guid>
      <dc:creator>jblng</dc:creator>
      <dc:date>2020-07-28T17:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: OSError: "[list of filenames]" does not exist</title>
      <link>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71786#M5913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your error is coming from this line:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AlterField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_%Name%"&lt;/SPAN&gt;&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;In Python3, comprehensions and generators have their own local namespaces, which prevents the bleeding of variable names from the structures into the calling namespace.&amp;nbsp; You can't call f.name because no variable named "f" has been created in either the local or global namespace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AlterField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fname&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fname&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_%Name%"&lt;/SPAN&gt;&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 17:48:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71786#M5913</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-07-28T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: OSError: "[list of filenames]" does not exist</title>
      <link>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71787#M5914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua, thank you. this makes sense and was helpful. Unfortunately I am now getting&amp;nbsp;an OSerror again, that a file doesn't exist. It seems as though the for fname loop is not being iterated at all, as it is not printing anything. I think it could have to do with the fname variable again, but I can't&amp;nbsp; tell what aspect of it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My updated code is as follows:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, sys
from arcpy import env

arcpy.env.overwriteOutput = True

# Set the workspace directory - make sure it's the copied gdb and not the original, in case you mess up
arcpy.env.workspace = r"mygdb_.gdb"

# Get the list of the zonal stats tables to process
tables = arcpy.ListTables()
print(tables)

# iterate through the tables in the gdb and update field names with the file names
for table in tables: 
 print("processing: " + table)
 expression = str(table) # populates field
 # iterate through field names in the table and alter field name
 for fname in [f.name for f in arcpy.ListFields(table, wild_card="*AFG_proj_zonalst", field_type="ALL") if not f.required]:
 &amp;nbsp;&amp;nbsp;&amp;nbsp;print(fname) 
 &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AlterField_management(table, fname, fname+'"'+expression+'"')
 &amp;nbsp;&amp;nbsp;&amp;nbsp;print(fname)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with arcpy.da.UpdateCursor(table, [fname]) as uc:
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for row in uc:
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uc.updateRow([str(table)])
&amp;nbsp;&amp;nbsp;&amp;nbsp; del row, uc&lt;/PRE&gt;&lt;P&gt;and the error message:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;[prints list of files] 
processing: NTL_QN_202001_AFG_proj_zonalst 
processing: NTL_QN_202001_AFG_zonalst 
processing: NTL_QN_202001_proj_zonalst 
processing: NTL_QN_202001_zonalst 
processing: NTL_201912_AFG_proj_zonalst 
processing: NTL_201911_AFG_proj_zonalst 
processing: NTL_201910_AFG_proj_zonalst 
processing: NTL_201909_AFG_proj_zonalst 
processing: NTL_201908_AFG_proj_zonalst 
processing: NTL_201907_AFG_proj_zonalst 
processing: NTL_201906_AFG_proj_zonalst 
processing: NTL_201905_AFG_proj_zonalst 
processing: NTL_201904_AFG_proj_zonalst 
processing: NTL_201903_AFG_proj_zonalst 
processing: NTL_201902_AFG_proj_zonalst 
processing: NTL_201901_AFG_proj_zonalst&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="color: #333333; padding: 5px 2ex;"&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;OSError&lt;/SPAN&gt;                                   
Traceback (most recent call last)&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;&amp;lt;ipython-input-5-7d2495ac6c17&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     
17&lt;/SPAN&gt;     expression &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;# populates field&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     
18&lt;/SPAN&gt;     &lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;# iterate through field names in the table and alter field name
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;---&amp;gt; 19&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;     &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;for&lt;/SPAN&gt; fname &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;in&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;f&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; wild_card&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"*AFG_proj_zonalst"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; field_type&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;not&lt;/SPAN&gt; f&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;required&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     
20&lt;/SPAN&gt;         print&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;fname&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;     
21&lt;/SPAN&gt;         arcpy&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;AlterField_management&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; fname&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; fname&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'"'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;+&lt;/SPAN&gt;expression&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'"'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;ListFields&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(dataset, wild_card, field_type)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   
1131&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;   
1132&lt;/SPAN&gt;         * String:   Only field types of String are returned."""
&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;-&amp;gt; 1133&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;     &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;return&lt;/SPAN&gt; gp&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;listFields&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;dataset&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; wild_card&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; field_type&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;   
1134&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;   
1135&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;@&lt;/SPAN&gt;_gptooldoc&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"FeatureLayer"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"Table"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"TableView"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"Dataset"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"FeatureDataset"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;""&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;""&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;""&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;listFields&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, *args)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    
346&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;arcobjects&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;arcobjectconversion &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;import&lt;/SPAN&gt; convertArcObjectToPythonObject&lt;SPAN class="" style="color: #00a250;"&gt;    
347&lt;/SPAN&gt;         return convertArcObjectToPythonObject(
&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 348&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;                     self._gp.ListFields(*gp_fixargs(args, True)))&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    
349&lt;/SPAN&gt;     &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;def&lt;/SPAN&gt; listIndexes&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;*&lt;/SPAN&gt;args&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;    
350&lt;/SPAN&gt;         &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"""GP function ListIndexes"""
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;OSError&lt;/SPAN&gt;: "NTL_201901_AFG_proj_zonalst" does not exist&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:46:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/oserror-quot-list-of-filenames-quot-does-not-exist/m-p/71787#M5914</guid>
      <dc:creator>jblng</dc:creator>
      <dc:date>2021-12-10T22:46:15Z</dc:date>
    </item>
  </channel>
</rss>

