How can one Python module break another?
Question: 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](https://github.com/Toblerity/rtree) and
ESRI's
[arcpy](http://resources.arcgis.com/en/help/main/10.1/index.html#//000v00000001000000),
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](http://github.com/Toblerity/rtree/issues/10), 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?


Answer: It happens when using:

    
    
    from (module) import * 
    

if both modules have functions with the same names. Shamelessly taken from
@karthikr

