Sporadic problems importing xml.dom.minidom

M

Michael Robinson

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.
 
M

Michael Robinson

Michael said:
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.

UPDATE:
It seems that some of the folders where the program worked, no longer work.
 
M

Michael Robinson

Michael said:
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
 
P

Peter Hansen

Michael said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top