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
4 Years
Discussion Span
Last Post by snippsat

Import is.

>>> import xml.etree.ElementTree as ET

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.

Edited by snippsat

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.