Search code examples
oraclearcgisesriarcpy

Connecting to ESRI ArcSDE 10.2 for Oracle with ArcPy


I had a Python script running ArcPy 10.0 connecting to SDE for Oracle through connection files. Everything worked great but when ArcGIS (ArcPy) was upgraded to 10.2.1 I can't get the ArcPy functions to return any results. I can connect to the database through the same connection file using ArcCatalog. I get no errors when trying to run an ArcPy function against the same connection file but I still get no results.

For example:

arcpy.ListFeatureClasses()

returns an empty list.

Any pointers for what might be causing this would be greatly appreciated.


Solution

  • This turned out to be a mismatch between versions of ArcPy. ArcGIS Engine was installed after ArcGIS Desktop which installed a new 64 bit version of Python2.7/ArcPy. 64bit ArcPy does NOT work in this context and so was the reason why the behavior was strange. I am not sure why this 64bit version would even be installed if it doesn't work correctly but I assume there must be a reason. The take home here is to make sure you are using a 32bit version of ArcPy.