重要错误:没有命名的模块元素树.ElementT

2024-09-20 22:55:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在运行Python2.7,并从另一个开发人员那里获得了一个项目,所以我只是试图让它进行编译,但由于老开发人员使用的是“import”,所以出现了导入错误元素树.elementtree作为ET“,所以我要四处转转,用“import”替换这个代码xml.etree.ElementTree如ET“

但是现在遇到了这个仍然无法编译的文件。回溯如下:

C:\Users\Daniel\Documents\Time clock\source\TimeClock>python timeclock.py
Traceback (most recent call last):
  File "timeclock.py", line 30, in <module>
    from CheckHoursDialog import CheckHoursDialog
  File "C:\Users\Daniel\Documents\Time clock\source\TimeClock\CheckHoursDi
alog.py", line 11, in <module>
    from StudentEarningReport import StudentEarningReport
  File "C:\Users\Daniel\Documents\Time clock\source\TimeClock\StudentEarni
ngReport.py", line 10, in <module>
    import elementtree.ElementTree as ET
ImportError: No module named elementtree.ElementTree

谁能给我指出正确的方向吗?在

这是文件的前40行。在

^{pr2}$

Tags: pyimportsourcetimelineusersdocumentset

热门问题