I have a very simple script that isn't working.
import arcpy
workspace = "C:\\Users\\Work\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\master.sde"
arcpy.env.workspace = workspace
wire = "gis.DBO.wire"
with arcpy.da.SearchCursor(wire, "id") as cursor:
for row in cursor:
print row[0]
It returns RuntimeError: cannot open 'gis.DBO.wire'
UPDATED
I still haven't figured this out. I just did a repair on ArcGIS Desktop 10.3, and that didn't solve it. So, then I removed Python, and reinstalled it and it still doesn't work.
I have this script I've tried running in PyScripter and IDLE:
import arcpy
sde = "C:\\Temp\\Data.sde"
domains = arcpy.da.ListDomains(sde)
I get:
And, yes it is a valid sde connection.
If I do the exact same code above in the Python window of ArcCatalog it works fine.
Here's the IDLE error:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
domains = arcpy.da.ListDomains(sde)
RuntimeError
workspace = r"Database Connections\master.sde"
?