Sporadic problems importing xml.dom.minidom

Peter Hansen peter at engcorp.com
Thu May 27 19:24:36 EDT 2004


Michael Robinson wrote:

> Michael Robinson wrote:
> 
>> Sometimes when I run a program I get the message "Import:Error No 
>> Moduel named dom.domino", sometimes it imports OK.  It seems to depend 
>> on the working directory when I star the program.
>>
>> /home/mike/projects/xml_test/test.py:
>>
>> Gives an erroor, the same file luanched from
>>
>> /home/mike/projects/xml1/test.py:
>>
>> runs without a problem
>>
>> I am running the python 2.3 package, bundeld with Fedora Core 2.
> 
> I think i solved the problem.  I had another file in those directorys 
> called xml.py, I guess that was interfeering

That could do it, and possibly compounding your problem was
that even a leftover xml.pyc file (from your xml.py file when
it was imported another time) would still cause the trouble.
If you do have a problem with a name collision like that,
always be sure to nuke the .py *and* the .pyc file at the
same time.

-Peter



More information about the Python-list mailing list