Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何修复属性错误:模块";x";没有属性_Python_Runtime Error_Pyinstaller_Converters - Fatal编程技术网

Python 如何修复属性错误:模块";x";没有属性

Python 如何修复属性错误:模块";x";没有属性,python,runtime-error,pyinstaller,converters,Python,Runtime Error,Pyinstaller,Converters,我正在尝试将我的项目转换为exe。这是tkinter gui类型的项目。在这个环境中,一切都很好,但当我将它转换为exe时,我确实遇到了一个问题。Gui显示,但主类不工作。我收到: AttributeError:模块“电子邮件”没有“发送电子邮件”属性 下面的代码在VisualStudio中运行良好,但在转换为exe时停止。谢谢你的帮助 import email ##my .py file with class main_class = email.Send_email() ## gettin

我正在尝试将我的项目转换为exe。这是tkinter gui类型的项目。在这个环境中,一切都很好,但当我将它转换为exe时,我确实遇到了一个问题。Gui显示,但主类不工作。我收到:

AttributeError:模块“电子邮件”没有“发送电子邮件”属性

下面的代码在VisualStudio中运行良好,但在转换为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中的标准模块名。您是否尝试过将模块重命名为其他模块


请参阅:

您如何转换它?@jammydowger pyinstaller带有控制台日志,“pyinstaller main.py”将完成转换,仍然需要等待2分钟:)再次感谢!这么明显的事情,从昨天起就是一场噩梦!别难过,我知道我做过不止一次同样的事