簡體   English   中英

無法在Python 2.7上導入cElementTree

[英]Can't import cElementTree on Python 2.7

我無法在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.pyc文件,該文件未顯示在PyCharm中。 它停止了“真實” XML的加載。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM