Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem importing xml.dom and xml.minidom

Status
Not open for further replies.

StoneDeCroze

Programmer
Feb 11, 2002
36
GB
Can anyone help?
If I run Python interactively any or all of the three following lines work:
import xml
import xml.dom
import xml.minidom

However when I create a script and run it, the only one to work is:
import xml

The other two produce the following error:
Traceback (most recent call last):
File "xml.py", line 1, in ?
import xml.dom
File "xml.py", line 1, in ?
import xml.dom
ImportError: No module named dom

I get the same problem on both my windows and linux boxes - what I have done wrong?

Peter
 
Make sure that your Python module is not named "xml.py", otherwise your module will be imported instead of the Python modules you are trying to import.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top