XML package loading (xmlproc)
Mark C Favas
mark at chem.uwa.edu.au
Sun Mar 26 06:13:41 EST 2000
Ian Oeschger <oeschger at netscape.com> writes: <snipped somewhat>
>I just installed the xml package on my Windows98 machine, and I am having some
>trouble getting Python to see some of the modules in there.
>However, when I try to load the xmlproc module from the package (e.g.
>fromxml.parsers.xmlproc import xmlproc) I get ImportError: No module named
>xmlproc. import xml.parsers.xmlproc also fails. So does from xml.parsers import
>*, though in this case because the xmlproc module is not actually loaded, not
>because there is any error message.
The problem is that the __init__.py file in .../xml/parsers/xmlproc is a
zero-length file, and winzip decides to be smart and not extract zero-length
files by default, so that your .../xml/parsers/xmlproc folder does not contain
an __init__.py file, which means that it is not recognised as a package, and
hence your error message. Just create an empty __init__.py file in that folder
and all will be well...
Mark
--
Email - mark at chem.uwa.edu.au ,-_|\ Mark C Favas
Phone - +61 9 380 3482 / \ Department of Chemistry
Fax - +61 9 380 1005 ---> *_,-._/ The University of Western Australia
v Nedlands
Loc - 31.97 S, 115.81 E Western Australia 6009
More information about the Python-list
mailing list