[XML-SIG] Assistant trouble shooting 'ImportError: No module named dom.ext.reader'

Hardison Leif Leif.Hardison at comverse.com
Tue Aug 16 20:09:28 CEST 2005


I'm currently working on learning Python's tools for working with XML.
So far I have installed Python 2.4.1 and PyXML 0.8.4 on a Debian 3.1
Linux host.

The error I'm receiving when running an example file is:

my-host:/home/.../scripts# /usr/local/bin/python xml2.py
Traceback (most recent call last):
  File "xml2.py", line 2, in ?
    from xml.dom.ext.reader import Sax2
  File "/home/.../scripts/xml.py", line 1, in ?
    from xml.dom.ext.reader import Sax2
ImportError: No module named dom.ext.reader

The xml2.py file looks like this:

import sys
from xml.dom.ext.reader import Sax2
from xml.dom.ext import PrettyPrint

reader = Sax2.Reader()

# get DOM object
doc = reader.fromStream("extract.xml")


Python and PyXML both installed with out producing any noticeable
errors.  I'm stumped as even the demo files listed in the PyXML
distribution say that they are out of date.

Any pointers and troubleshooting advice appreciated.


Leif Hardison
> Data Center Engineer
leif.hardison at comverse.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/xml-sig/attachments/20050816/af2a1eb6/attachment.htm

More information about the XML-SIG mailing list