2011-05-31 129 views
3

你能否解釋我下面的錯誤,並給我一個解決方法?Python的XML解析問題

在此先感謝!

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' 
>>> 
+0

沒有看到導致錯誤的程序,我們無法解釋它。現在請不要發佈整個程序,但請嘗試找出造成問題的部分,然後發佈。見[這裏](http://sscce.org/)。 – 2011-05-31 09:28:11

+0

如果我打開python交互式shell,並給出上面的兩行,我會收到此錯誤消息。沒有更多的代碼。 – bayerb 2011-05-31 09:34:18

+0

你真的必須使用Python 2.4.3嗎? :) – 2011-05-31 09:59:25

回答

0

問題似乎與您的python版本和python庫。

看一看here

+0

什麼是「python blender」?對不起,這個愚蠢的問題,但我還沒有找到任何與谷歌有關... – bayerb 2011-05-31 10:45:36

+0

blender是庫,實際上版本您的python庫與您的python版本不兼容.. – 2011-05-31 11:30:53

+0

是否有限制條件的任何解決方法,我無法更改版本? – bayerb 2011-05-31 12:32:54