<?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: NoneType object is not iterable in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644421#M50228</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code was written in one of your online courses called “Python Scripting for Geoprocessing Workflows” Can you please help to rewrite the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Sep 2018 23:32:22 GMT</pubDate>
    <dc:creator>JeremiahGbolagun1</dc:creator>
    <dc:date>2018-09-18T23:32:22Z</dc:date>
    <item>
      <title>NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644417#M50224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there, when I run this code in PyScripter IDE I received this error 'NoneType is not iterable'.&lt;/P&gt;&lt;P&gt;Can you please help to address this problem.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;#Set geoprocessing environments&lt;BR /&gt;arcpy.env.workspace = ("C:\EsriTraining\Python10_0\Data\SanJuan.gdb")&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;#Create list of feature classes in SanJuan.gdb&lt;BR /&gt;fcList = arcpy.ListFeatureClasses()&lt;BR /&gt;#Create a loop to buffer Lakes and Streams&lt;BR /&gt;bufferList = []&lt;BR /&gt;for fc in fcList:&lt;BR /&gt; if fc == "Lakes" or fc == "Streams":&lt;BR /&gt; arcpy.Buffer()&lt;BR /&gt; arcpy.Buffer_analysis(fc, fc + "Buffer", "1000 meters")&lt;BR /&gt; bufferList.append(fc + "Buffer")&lt;BR /&gt; arcpy.Union_analysis(bufferList, "WaterBuffers")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 22:51:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644417#M50224</guid>
      <dc:creator>JeremiahGbolagun1</dc:creator>
      <dc:date>2018-09-18T22:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644418#M50225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please format your code for readability:&amp;nbsp;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume your code is failing at:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; fc &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fcList&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;Try printing fcList to see if it's empty. I suspect it's because your path isn't a raw string (backslashes in paths are bad). 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;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\EsriTraining\Python10_0\Data\SanJuan.gdb"&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;If none of this helps, please format your code and indicate where the error occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: this line is surely wrong:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Buffer&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, 18 Sep 2018 22:57:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644418#M50225</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-09-18T22:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644419#M50226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added r and yet the same error occurred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 23:08:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644419#M50226</guid>
      <dc:creator>JeremiahGbolagun1</dc:creator>
      <dc:date>2018-09-18T23:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644420#M50227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;adding the r is a start, but you didn't see Darren's statement&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;arcpy.Buffer()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;that line will fail.&amp;nbsp; In fact, in its current state you code will fail because it is not formatted properly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;Now the error message indicates that there are no featureclasses in your featureclass list&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm"&gt;ListFeatureClasses—ArcPy Functions | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;or it failed because of the arcpy.Buffer() line,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 23:17:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644420#M50227</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-18T23:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644421#M50228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code was written in one of your online courses called “Python Scripting for Geoprocessing Workflows” Can you please help to rewrite the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 23:32:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644421#M50228</guid>
      <dc:creator>JeremiahGbolagun1</dc:creator>
      <dc:date>2018-09-18T23:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644422#M50229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I removed the ‘arcpy.Buffer() the code failed at “for fc in fcList:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 23:38:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644422#M50229</guid>
      <dc:creator>JeremiahGbolagun1</dc:creator>
      <dc:date>2018-09-18T23:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644423#M50230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;put a print statement before that line and see if there is anything there to cycle through&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie&lt;/P&gt;&lt;P&gt;print("found.... {}".format(fcList))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 23:40:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644423#M50230</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-18T23:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644424#M50231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the outcome Dan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 23:50:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644424#M50231</guid>
      <dc:creator>JeremiahGbolagun1</dc:creator>
      <dc:date>2018-09-18T23:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644425#M50232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so the print statement? did you put it in?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 23:57:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644425#M50232</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-18T23:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644426#M50233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I did. Did you see the print screen image I sent to you Dan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 00:01:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644426#M50233</guid>
      <dc:creator>JeremiahGbolagun1</dc:creator>
      <dc:date>2018-09-19T00:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644427#M50234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;found it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try just one line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does it error out?&amp;nbsp; It never makes it to the print statement which suggests something else&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 00:04:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644427#M50234</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-19T00:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644428#M50235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's in the previous 9 lines?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 01:50:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644428#M50235</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-09-19T01:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: NoneType object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644429#M50236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;from arcpy import env ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2019 22:51:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/nonetype-object-is-not-iterable/m-p/644429#M50236</guid>
      <dc:creator>DanielJones6</dc:creator>
      <dc:date>2019-02-15T22:51:05Z</dc:date>
    </item>
  </channel>
</rss>

