解決python-xml 模組 在ubuntu karmic中找不到的問題

來源:互聯網
上載者:User

如下錯誤:
 from xml.dom.ext.reader.Sax2 import FromXmlStream
ImportError: No module named ext.reader.Sax2

轉自:https://bugs.launchpad.net/ubuntu/+source/python-xml/+bug/343242

runo Harbulot wrote on 2009-11-29:
#22

Going
back to Windows just because of this seems a bit radical. If PyXML is
what's required, doing the following seems rather straightforward
compared with some DLL conflicts:

1. Download PyXML-0.8.4.tar.gz from http://sourceforge.net/projects/pyxml/files/
2. You may need to install python2.6-dev, for example via: sudo apt-get
install python2.6-dev
3. Use these commands:
tar xvzf PyXML-0.8.4.tar.gz
cd PyXML-0.8.4
wget http://launchpadlibrarian.net/31786748/0001-Patch-for-Python-2.6.patch
patch -p1 < 0001-Patch-for-Python-2.6.patch
sudo python2.6 setup.py install

I still reckon PyXML should be packaged in its own package (if the
other things in python-xml are broken). I think the patch is easy
enough for it to be dealt with as part of the packaging process.
Libxml2 may be the modern way to do XPath in Python, but having all the
legacy applications (whether-or-not packaged by Debian/Ubuntu) that
currently rely on PyXML change their code to use libxml2 sounds like a
lot of work, possibly unrealistic.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.