AttributeError:“<无效类型>"对象没有属性“退出"

编程入门 行业动态 更新时间:2024-10-25 21:19:13
本文介绍了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:“&lt;无效类型&gt;"对象没有属性“退出"

本文发布于:2023-10-22 08:17:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1516965.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:属性   对象   类型   amp   AttributeError

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!