简体   繁体   中英

Python xml parsing problem

could you please explain me the error below, and give me a workaround?

Thanks in advance!

Python 2.4.3 (#1, Apr 14 2011, 20:41:59)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.sax import make_parser
>>> p = make_parser()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib64/python2.4/site-packages/_xmlplus/sax/sax2exts.py", line 37, in make_parser
    return XMLParserFactory.make_parser(parser_list)
  File "/usr/lib64/python2.4/site-packages/_xmlplus/sax/saxexts.py", line 75, in make_parser
    sys.modules[parser_name].create_parser = _create_parser
KeyError: 'xml.sax.drivers2.drv_pyexpat'
>>>

Problem seems to be with your python version and python library.

Have a look here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM