[XML-SIG] PyXML newbie problem

Morten Bagai lists@bagai.com
Sun, 29 Dec 2002 15:02:27 +0100


Hello,

Python newbie here, trying to get started with XML processing in 
Python. I'm using MacOS X 10.2, which I gathered hasn't got PyXML 
installed by default. Therefore I downloaded the latest version (0.8.1) 
of PyXML and attempted a build+install. All appeared to go reasonably 
well, but I can't quite get it to work.

Here's a simple examlple I tried in the interpreter:

from xml.dom import minidom
doc = minidom.parse('/Library/WebServer/Documents/books.xml')

This yields the following error:

Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "xml/dom/minidom.py", line 1594, in parse
     from xml.dom import expatbuilder
   File "xml/dom/expatbuilder.py", line 32, in ?
     from xml.parsers import expat
   File "xml/parsers/expat.py", line 4, in ?
     from pyexpat import *
ImportError: No module named pyexpat


So it appears something wasn't installed properly after all? Any 
pointers would be greatly appreciated.

Thanks,

Morten