我在 .exe 文件中用 python 转换我的 kivy 应用程序时遇到问题

问题描述 投票:0回答:0

我尝试使用pyinstaller和auto-py-to-exe转换它,两种方式都是同样的错误error image

这是我的 .py 文件:

import kivy
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from otro import suma
Builder.load_file("angel.kv")

class mainclass(BoxLayout):
    def press(self):
        self.ids.caja.text = suma()
class app(App):
    def build(self):
        return mainclass()
    
if __name__ == '__main__':
    app().run()

另一个:

def suma():
    a = 2 + 2
    a = str(a)
    return a

.kv文件:

     <mainclass>:
    canvas:
        Color: 
            rgb: 1,1,1
        Rectangle:
            size: self.size
            pos: self.pos
    TextInput:
        id: caja
    Button:
        text: 'press me'
        on_press: root.press()

我试图在 .exe 中转换一个更大的 kivy 应用程序,但我得到了这个错误,所以我创建了这个非常简单的应用程序只是为了测试,我也有同样的错误,该应用程序在文本编辑器中运行完美

python kivy pyinstaller exe auto-py-to-exe
© www.soinside.com 2019 - 2024. All rights reserved.