我的 .exe 文件未运行,而我的 .py 文件运行良好

发布于 2025-01-12 11:19:18 字数 1188 浏览 0 评论 0原文

我用 kivy 编写了一个 python 应用程序。

我想从 python 应用程序创建一个扩展名为 .exe 的文件,但是当我使用 auto-py-to-exe 程序(该程序允许从 python 文件创建 .exe 文件)时,该文件会正确创建,但是在启动时我的 .exe 文件中,应用程序无法启动,我不明白为什么返回的错误是这样的。

我也尝试通过 pyinstaller 但问题仍然存在。我认为它来自代码,但代码在我的 VScode 上运行良好,所以我不明白它不能在 .exe 中运行。

以下是返回的错误:

Traceback (most recent call last):
File "kivy\properties.pyx", line 861, in kivy.properties.ObservableDict.__getattr__
KeyError: 'top_box'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "myvide.py", line 462, in <module>
  File "kivy\app.py", line 949, in run
  File "kivy\app.py", line 919, in _run_prepare
  File "myvide.py", line 198, in build
  File "kivy\properties.pyx", line 864, in kivy.properties.ObservableDict.__getattr__
AttributeError: 'super' object has no attribute '__getattr__'

“top_box”是 BoxLayout 的标识符,我用它来在其中放置多个信息,因此我不能简单地删除它。

这是第 198 行: self.topicsSelectionScreen.ids.top_box.add_widget(self.header)

这是我的 github 代码:https://github.com/sdourte/MyVideGraff.git

谢谢。

I have wrote a python application with kivy.

I want to create a file with an .exe extension from my python application but when I use the auto-py-to-exe program which allows to create an .exe file from a python file, the file is created correctly, however at launch of my .exe file, the application does not launch and I do not understand why the error returned is this.

I also tried via pyinstaller but the problem remains the same. I think it comes from the code but the code works fine on my VScode so I don't understand that it can't run in .exe.

Here is the errors returned :

Traceback (most recent call last):
File "kivy\properties.pyx", line 861, in kivy.properties.ObservableDict.__getattr__
KeyError: 'top_box'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "myvide.py", line 462, in <module>
  File "kivy\app.py", line 949, in run
  File "kivy\app.py", line 919, in _run_prepare
  File "myvide.py", line 198, in build
  File "kivy\properties.pyx", line 864, in kivy.properties.ObservableDict.__getattr__
AttributeError: 'super' object has no attribute '__getattr__'

"top_box" is the identifier of a BoxLayout that I use to put several information in it, so I can't simply remove it.

Here is the 198th line : self.topicsSelectionScreen.ids.top_box.add_widget(self.header)

Here is my github with the code : https://github.com/sdourte/MyVideGraff.git

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文