Search This Blog

Python: module file name conflicts with the package name

I have a python module file named xml.py, in the module

import xml.etree.ElementTree as ET
... ...
When executing the file, it raises the following error:

ImportError: No module named etree.ElementTree
According the stackoverflow post, it was caused by the moudle file name xml.py, rename the xml.py to something else resolved the issue.

No comments:

Post a Comment