Standard
Standard

Reputation: 1522

Can't import cElementTree on Python 2.7

I cannot import xml.etree.cElementTree on Python 2.7. On the web, it says its already implemented, so I don't have to install it. (It's working on Python 3.6 for me, but I need 2.7 for reasons here)

Thats the console output:

Python 2.7.15+ (default, Nov 27 2018, 23:36:35) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.etree.cElementTree
Failed to import cElementTree from any known place
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named etree.cElementTree

I hope you can help me.

Kind regards, Markus

Upvotes: 0

Views: 184

Answers (1)

Standard
Standard

Reputation: 1522

I just found out that theres an old xml.pyc file in that directory, which didnt show up in PyCharm. It stopped the "real" XML from loading.

Upvotes: 0

Related Questions