ImportError: No module named sax.handler?

"Martin v. Löwis" martin at v.loewis.de
Fri Nov 30 01:20:58 EST 2007


> I'm lost here. When I put this line
> 
> from xml.sax.handler import ContentHandler
> 
> in a .py file and run it, I get the ImportError. When I execute it in
> shell, there is no error.
> 
> Why?

Because you have another module called xml in your path that is found
first and has no sax package in it.

Regards,
Martin



More information about the Python-list mailing list