Another user successfully imports xml. When I try to import xml, Python can't find the module. Why is that?
My traceback:
>>> import xml
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "xml.py", line 13, in <module>
from xml.etree import ElementTree as ET
ImportError: No module named etree
This is on Linux.
rypel
4,8742 gold badges27 silver badges36 bronze badges
1 Answer 1
You have a local module named xml.py; this masks the built-in package.
You'll have to rename that package; it is importing itself otherwise.
answered Sep 3, 2014 at 10:25
Martijn Pieters
1.1m326 gold badges4.2k silver badges3.5k bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py