简体   繁体   English

Python XML 不是包错误

[英]Python XML is not a package error

I am trying to get the values from the XML file, using python 3.4, but I am getting an error while compiling the file.我正在尝试使用 python 3.4 从 XML 文件中获取值,但是在编译文件时出现错误。 The error saying错误说

ImportError: No module named 'xml.etree'; 'xml' is not a package

I have also tried to install the lxml package, but it is already existing, then I don't know why I am getting this error.我也试过安装 lxml 包,但它已经存在,然后我不知道为什么我会收到这个错误。

Can someone, please help me with this.有人可以帮我解决这个问题。

Thanks,谢谢,

不要将您的文件保存为xml.py ,而是使用不同的文件名。

Thanks everyone, actually It worked after changing the file name.谢谢大家,其实改文件名就可以了。 I believe there was a conflict with the file name while compiling.我相信编译时文件名有冲突。 So, after changing the file name it worked.因此,在更改文件名后,它起作用了。 Thanks for all your time.感谢您的所有时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM