I
I
Ilya2017-07-04 04:14:40
Python
Ilya, 2017-07-04 04:14:40

Python problem with XML, why doesn't the standard library want to work?

The code

import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml')
root = tree.getroot()

Mistake
Traceback (most recent call last):
  File "F:\xml.py", line 1, in <module>
    import xml.etree.ElementTree as ET
  File "F:\xml.py", line 1, in <module>
    import xml.etree.ElementTree as ET
ModuleNotFoundError: No module named 'xml.etree'; 'xml' is not a package

What is the problem, I can't figure it out.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question