Weird scope error[SOLVED?]

Rory McKinley rorymckinleylists at
Sun Apr 6 09:13:40 CEST 2008

Kay Schluehr wrote:
> On 5 Apr., 23:08, Michael Torrie <torr... at> wrote:
>>  You need to either fix all these imports in these other modules (that
>> are probably in the site_packages folder), or modify the python import
>> path so that it can find ElementTree directly.
> I'd prefer to set an alias in the module cache:
>>>> import sys
>>>> import xml.etree
>>>> sys.modules["elementree"] = xml.etree
>>>> from elementree import ElementTree

Thank you Kay, Michael, and Gary for all suggestions and patience. I had 
actually changed the import inside the module itself, but it was still 
complaining. I was testing using the interactive console. This morning, 
without actually touching the module file again, I fired up the console 
and bingo! it works. So, it appears that the console was perhaps 
"cacheing" the module - does that make sense?



More information about the Python-list mailing list