本文介绍了AttributeError:“<无效类型>"对象没有属性“退出"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
运行from sys import exit时引发错误:Line 2: AttributeError: '<invalid type>' object has no attribute 'exit'.我该如何解决?代码的问题部分:
Throws error: Line 2: AttributeError: '<invalid type>' object has no attribute 'exit' when from sys import exit is run. How do I fix this? Problem part of code:
from sys import exit推荐答案
您是否偶然创建了名为sys的模块或文件?如果是这样,则是从本地模块而不是从内置的Python sys模块
Did you happen to create a module or file called sys? If so you are importing from your local module rather than from the built-in Python sys module
否则,这些导入命令区分大小写,请确保所有内容均使用小写(在您的帖子中,但您永远不会知道):
Otherwise, these import commands are case sensitive, make sure everything is in lower case (it is in your post, but you never know):
from sys import exit更多推荐
AttributeError:“<无效类型>"对象没有属性“退出"
发布评论