I am trying to learn element tree so that i cna work with xml files a little more indepth. I have researched it and everythign i have read says that my version of python should have ElementTree already installed on it. But every time i try to run my sample script i get a error. I am running python 2.7.3 on unbuntu. If someone could help me fix this i would be greatly apriciated.

Traceback (most recent call last):
  File "/home/hatterx/Desktop/elementtree.py", line 1, in <module>
    from elementtree.ElementTree import Element
  File "/home/hatterx/Desktop/elementtree.py", line 1, in <module>
    from elementtree.ElementTree import Element
ImportError: No module named ElementTree

Import is.

>>> import xml.etree.ElementTree as ET
>>> ET.VERSION
'1.3.0'

And you should not name file elementtree.py,it shall not be in desktop folder.
This is a file in Pyhon library.

For me only Beautiful Soup or lxml for parsing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.