我不能在Python2.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我希望你能帮助我。
致以亲切的问候,马库斯
发布于 2019-09-05 21:00:05
我刚刚发现那个目录中有一个旧的xml.pyc文件,它没有在PyCharm中显示出来。它阻止了“真正的”XML的加载。
https://stackoverflow.com/questions/57805655
复制相似问题