【发布时间】:2019-09-05 12:35:54
【问题描述】:
我无法在 Python 2.7 上导入 xml.etree.cElementTree。在网上,它说它已经实现了,所以我不必安装它。 (它在 Python 3.6 上为我工作,但我需要 2.7 的原因)
这是控制台输出:
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
我希望你能帮助我。
亲切的问候, 马库斯
【问题讨论】:
-
只是
xml.etree.ElementTree。 -
@DanielRoseman cElementTree 也应该可以用于更高的性能。但它也无法导入 xml.etree.ElementTree (同样的问题)
标签: python python-2.7 import console celementtree