By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,767 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,767 IT Pros & Developers. It's quick & easy.

ImportError: No module named sax.handler?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.