471,336 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

ImportError: No module named sax.handler?

Hello,

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?

Thanks for your help!
Nov 30 '07 #1
2 3781
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
Nov 30 '07 #2
On Nov 29, 8:20 pm, "Martin v. Lwis" <mar...@v.loewis.dewrote:
Because you have another module called xml in your path that is found
first and has no sax package in it.
Thank you Martin. Actually it was the .py file itself. I named it
xml.py.
Nov 30 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Carsten Gehling | last post: by
reply views Thread by Wicked | last post: by
reply views Thread by M. Lavasani | last post: by
4 posts views Thread by prashant | last post: by
reply views Thread by Robert Dailey | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.