How to fix AttributError: module "x" has no attribute
How to fix AttributError: module "x" has no attribute
我正在尝试将我的项目转换为 exe。这是 tkinter gui 类型的项目。在环境中一切正常,但是当我将它转换为 exe 时,我确实遇到了一个问题。 Gui 显示,但主要 class 不工作。我收到:
AttributeError: module 'email' has no attribute 'Send_email'
下面的代码在 visual studio 中运行良好,但在转换为 exe 时停止。感谢您的帮助。
import email ##my .py file with class
main_class = email.Send_email() ## getting Send_email class
main_class.mechanism_bot(user,issue,body) ## getting the function from the class
我相信 email
是 Python 中的标准模块名称。您是否尝试过将模块重命名为其他名称?
参见:https://docs.python.org/3/library/email.html#module-email
我正在尝试将我的项目转换为 exe。这是 tkinter gui 类型的项目。在环境中一切正常,但是当我将它转换为 exe 时,我确实遇到了一个问题。 Gui 显示,但主要 class 不工作。我收到:
AttributeError: module 'email' has no attribute 'Send_email'
下面的代码在 visual studio 中运行良好,但在转换为 exe 时停止。感谢您的帮助。
import email ##my .py file with class
main_class = email.Send_email() ## getting Send_email class
main_class.mechanism_bot(user,issue,body) ## getting the function from the class
我相信 email
是 Python 中的标准模块名称。您是否尝试过将模块重命名为其他名称?
参见:https://docs.python.org/3/library/email.html#module-email