Expat confusion

Bruce Sass bsass at freenet.edmonton.ab.ca
Mon May 28 21:46:01 EDT 2001


On 28 May 2001, Cameron Laird wrote:

> How do I generate an installation that
>   import xml.parsers.expat
> correctly?
>
> Suppose I'm working on a Unix host, from 2.0 or later
> sources.  I recognize I need to have expat installed
> (what does that mean?  Is it something other than having
>   /usr/local/lib/libexpat.a
>   /usr/local/bin/xmlwf
>   /usr/local/bin/gennmtab
> ?).  How do I get the generation procedure to make a
> pyexpat.so, though?
>
> The most immediate symptom of my discontent is
>   Traceback (most recent call last):
>     File "<stdin>", line 1, in ?
>     File "/usr/local/src/Python-2.1/Lib/xml/parsers/expat.py", line 4, in ?
>       from pyexpat import *
>   ImportError: No module named pyexpat
> when I attempt the import above.

I would expect you should have a...

	/usr/local/lib/python2.1/lib-dynload/pyexpat.so

...if everything worked ok.

Check this out...
~$ locate expat.so
/usr/lib/libexpat.so.0
/usr/lib/libexpat.so.0.0.1
/usr/lib/python1.5/site-packages/xml/parsers/pyexpat.so
/usr/lib/python2.0/lib-dynload/pyexpat.so
/usr/lib/python2.0/site-packages/_xmlplus/parsers/pyexpat.so

I also have python2.1 in /usr/local, but the expat stuff didn't build
(probably because I didn't have the -dev package for expat installed,
so Python didn't know about libexpat).

The debianizing .diff to the original source for 2.1 expects a
pyexpat.so to be produced, and wants to put it into .../lib-dynload.

HTH


- Bruce

p.s. - Your name is familiar, from the debian-user list?
If so... http://people.debian.org/~flight/python2
will be of interest.






More information about the Python-list mailing list