I'm working with SDE connection and want to find if a layer exists on a server. Code sample is:
ws = r'Database Connections\Connection to sde-srv.sde'
# second option to access connection file, same result
# ws = r'c:\Users\CurrentUser\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\Connection to sde-srv.sde'
arcpy.env.workspace = ws
fcs = []
for fd in arcpy.ListDatasets():
for fc in arcpy.ListFeatureClasses(feature_dataset = fd):
fcs.append(fc)
print fcs # []
The problem is that everything is OK if I run this in ArcMap console (fcs contains all the FCs from server), but when runnig it in a standalone script outside the ArcMap app SDE seems to be empty.
On top of it running this script with x32 Python crashes with Win error. With x64 it just returns empty list.
Listing any other sources (GDBs and so on) works well in any case.
arcpy.Exists(ws)
returns True in both cases.
*UPD. It's not the same situation as described in 'possible duplicate' question (and few others that I've checked before with almost the same title). There is no problem with full/relative path, absence of FC/FD, encodings, priveleges ...
*UPD2 Win10, ArcGIS 10.2.2.3552, both x32 and x64 (Background processing) Python interpreters installed. RDBMS: Oracle 11g (seems to be 11.2.0)