当我尝试用pyqt4应用程序创建一个onefile exe时,我有4个脚本组成了整个程序。我已经创建了一个exe,但是当我执行文件时,我从追溯中获取了file "<string>" line 172 in <module>file "<string>" line 33 in __init__AttributeError: 'QAction' object has no attribute 'activated'不知道我可能会缺少什么。我遵循了pyinstaller文档。任何帮助都将受到高度赞赏。这些线路已激活self.ui.actionExport_Database.activated.connect(self.dbexport)self.ui.actionExport_Entire_Database.activated.connect(self.dbexportall)self.ui.actionClose.activated.connect(self.close)我用于exe的命令是python pyinstaller.py --onefile yourprogram.pywpython pyinstaller.py --onefile your-program.spec不知道我是否应该等到第二个命令使用onefile选项。
2 回答

阿晨1998
TA贡献2037条经验 获得超6个赞
我怀疑当您运行脚本而不是二进制文件时,也会发生相同的错误,因此该问题与PyInstaller无关。
因为它看起来像self.ui.actionExport_Database
等都是的QAction的情况下,这的确没有属性activated
。您可能是说triggered
:
当用户激活某个动作时,将发出此信号。例如,当用户单击菜单选项,工具栏按钮或按下操作的快捷键组合时,或在调用trigger()时。
添加回答
举报
0/150
提交
取消