After several hours of debugging and trial and error, I found that importing two independent Python modules caused a function in one of them to stop working.
import arcpy
# works
sde_conn = arcpy.ArcSDESQLExecute(r"C:\temp\test.sde")
Yet:
import arcpy
import rtree
# fails
sde_conn = arcpy.ArcSDESQLExecute(r"C:\temp\test.sde")
The two Python modules are rtree and ESRI's arcpy, both of which I have running on Windows (the issue occurs on both Windows 7 and Windows Server 2008 R2, and on 32 bit and 64 bit Python installations).
I logged the issue, but I'd like to know what are the possible causes of one module breaking a function in another?
I had a quick check for globals, and modifying the system path. Both also rely on DLLs.
What other factors could be responsible?
It happens when using:
from (module) import *
if both modules have functions with the same names. Shamelessly taken from @karthikr
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With