XML Parser Trouble in Python 2.1

Van Gale cgale1 at _remove_home.com
Tue May 29 23:34:48 EDT 2001


Download expat from http://sourceforge.net/projects/expat/

Then, after building it, you need to rebuild your Python and include pyexpat
in the list of modules (i.e. follow the instructions in Modules/Setup).

ActiveState includes expat/pyexpat by default in their distribution, which
is why it worked for you on Windows.

"David Lees" <deblNospammmy at theworld.com> wrote in message
news:3B144684.6EB5DAB9 at theworld.com...
> Yup, when I try your import I get:
>
> import xml.parsers.expat
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/local/python21/lib/python2.1/xml/parsers/expat.py", line 4,
> in ?
>     from pyexpat import *
> ImportError: libexpat.so.0: cannot open shared object file: No such file
> or directory
>
> ----------
> Can someone tell me where I get the missing library(s) from?
>
> Thanks,
>
> David Lees
>
>
> Paul Prescod wrote:
> >
> > David Lees wrote:
> > >
> > >...
> > >
> > > However, when I try executing it on my RedHat Linux 7.1 system I get
the
> > > following error stack, which puzzles me.  I do not understand why some
> > > of the error messages even refer to 'sax' parser, since I am using
dom.
> > > And I am puzzled why I get any errors in the first place.
> >
> > I have a feeling you are missing the expat library. Try this:
> >
> > >>> import xml.parsers.expat
> > >>> parser = xml.parsers.expat.ParserCreate()
> >
> > --
> > Take a recipe. Leave a recipe.
> > Python Cookbook!  http://www.ActiveState.com/pythoncookbook





More information about the Python-list mailing list