<?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: RuntimeError: cannot open feature class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48568#M3858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I set the workspace and passed the feature class name (list created using arcpy.da.walk). This worked with the test file GDB.&lt;/P&gt;&lt;P&gt;Are you suggesting that each feature class be set as the full path to it, and not just the fc name?&lt;/P&gt;&lt;P&gt;e.g. C:\\Users\\user1\\AppData\\Roaming\\ESRI\\Desktop10.2\\ArcCatalog\\user1@sdeProd\\sdeProd.DBO.PlanningZoning\\sdeProd.DBO.MunicipalLimits&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 May 2015 12:13:12 GMT</pubDate>
    <dc:creator>CFrate</dc:creator>
    <dc:date>2015-05-27T12:13:12Z</dc:date>
    <item>
      <title>RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48562#M3852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My script below gets to the first feature class in the list and bails with:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;RuntimeError: cannot open 'Roads'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested it in a file geodatabase and it worked as intended. Tried next with a connection to an SDE version and it failed.&lt;/P&gt;&lt;P&gt;User connection has full edit privileges to all GDB contents, so it should not be a permissions issue.&lt;/P&gt;&lt;P&gt;Anything additional I must do for an SDE geodatabase? Other thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; edit.startEditing(True)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fc in fclist:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(fc, ("OBJECTID", "OID@")) as cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = row[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del row
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del cur
&amp;nbsp;&amp;nbsp;&amp;nbsp; edit.stopEditing(True)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48562#M3852</guid>
      <dc:creator>CFrate</dc:creator>
      <dc:date>2021-12-10T21:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48563#M3853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlo,&lt;/P&gt;&lt;P&gt;No answer for you right now, but just want to point out &lt;A href="https://community.esri.com/migration-blogpost/1070"&gt;Posting Code blocks in the new GeoNet&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Python, spacing is important, so having the code posted as such will rule out GeoNet messing with the spacing.&amp;nbsp; You can go and edit you post.....and it will help for future posts too. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 20:52:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48563#M3853</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-05-26T20:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48564#M3854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! I'd been looking everywhere for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 20:59:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48564#M3854</guid>
      <dc:creator>CFrate</dc:creator>
      <dc:date>2015-05-26T20:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48565#M3855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't have it bookmarked, type in "posting code" in any of the geonet search boxes....it's the post by &lt;A href="https://community.esri.com/migrated-users/3355"&gt;Curtis Price&lt;/A&gt;​&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 21:14:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48565#M3855</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-05-26T21:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48566#M3856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I run update cursors on SDE fairly often without a problem. Nothing special about it from my perspective.&amp;nbsp; Are you passing the full path to the feature class, or setting the workspace and passing the fc name?&amp;nbsp; I almost always pass the full path and haven't had a problem.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 21:26:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48566#M3856</guid>
      <dc:creator>BillDaigle</dc:creator>
      <dc:date>2015-05-26T21:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48567#M3857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since "OID@" is a token for the ObjectID field, usually "ObjectID," what exactly are you attempting to do?&amp;nbsp; Does your feature class have a different unique identifier field than "ObjectID?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are starting an edit session, but it doesn't look like you have started an edit operation.&amp;nbsp; Before any updating can begin, an edit operation needs to be started as well.&amp;nbsp; See &lt;STRONG style="color: #4d4d4d; text-indent: 0px;"&gt;Editor example 2&lt;/STRONG&gt; from the &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Editor/018w00000005000000/"&gt;Editor (arcpy.da) &lt;/A&gt;help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 00:06:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48567#M3857</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-05-27T00:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48568#M3858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I set the workspace and passed the feature class name (list created using arcpy.da.walk). This worked with the test file GDB.&lt;/P&gt;&lt;P&gt;Are you suggesting that each feature class be set as the full path to it, and not just the fc name?&lt;/P&gt;&lt;P&gt;e.g. C:\\Users\\user1\\AppData\\Roaming\\ESRI\\Desktop10.2\\ArcCatalog\\user1@sdeProd\\sdeProd.DBO.PlanningZoning\\sdeProd.DBO.MunicipalLimits&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 12:13:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48568#M3858</guid>
      <dc:creator>CFrate</dc:creator>
      <dc:date>2015-05-27T12:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48569#M3859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I've tried the edit session using 2-3 different methods, but none so far have worked. And, again, this script as posted worked on the file GDB; only repeating it in SDE is proving difficult.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, the field "OBJECTID" is not the OID. The operation should calculate the field to be the same value as the OID field. Convoluted, I know, but it's a temporary fix to a separate problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 12:32:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48569#M3859</guid>
      <dc:creator>CFrate</dc:creator>
      <dc:date>2015-05-27T12:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48570#M3860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the error is "Cannot open 'Roads'", it seems as though it might be having trouble finding the dataset.&amp;nbsp; I get the same error if I run the following lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

with arcpy.da.SearchCursor('NonExistantFC',('ObjectId')) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:52:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48570#M3860</guid>
      <dc:creator>BillDaigle</dc:creator>
      <dc:date>2021-12-10T21:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48571#M3861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want to try checking if the 'fc' exists.&amp;nbsp; If not, you know you're dealing with a pathing issue. &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for fc in fclist:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc, arcpy.Exists(fc)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:52:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48571#M3861</guid>
      <dc:creator>BillDaigle</dc:creator>
      <dc:date>2021-12-10T21:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: cannot open feature class</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48572#M3862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like that's the issue! Indeed Exists returned False for everything.&lt;/P&gt;&lt;P&gt;I've amended the paths accordingly, but now have run into a new runtime error: &lt;EM&gt;workspace already in transaction mode&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There seem to be a few other threads referencing this error, so I'll have a look at those. Something to do with the fact that I'm editing in a version, perhaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;edit:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Solution I found to this error was to remove any feature classes not registered as versioned. This was only one from my list, so it wasn't an issue.&lt;/P&gt;&lt;P&gt;Trying edit.startEditing(True, False) as recommended in other threads did not work.&lt;/P&gt;&lt;P&gt;Removing edit operation only solved the issue for some feature classes, but when it reached certain others, the process would fail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 15:51:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-cannot-open-feature-class/m-p/48572#M3862</guid>
      <dc:creator>CFrate</dc:creator>
      <dc:date>2015-05-27T15:51:36Z</dc:date>
    </item>
  </channel>
</rss>

