Estou aprendendo o kivy (então sou bem virgem no assunto gui) e me deparei com esse erro:
parte importante: AttributeError: ‘weakref’ object has no attribute ‘cline_in_traceback’
execução completa:
[INFO ] [Logger ] Record log in /home/albuquerque/.kivy/logs/kivy_19-04-21_53.txt [INFO ] [Kivy ] v1.11.0.dev0, git-eec3a30, 20190421 [INFO ] [Python ] v3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] [INFO ] [Factory ] 184 symbols loaded [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored) [INFO ] [Text ] Provider: sdl2 [INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored) [INFO ] [GL ] Using the "OpenGL" graphics system [INFO ] [GL ] Backend used <sdl2> [INFO ] [GL ] OpenGL version <b'4.6.0 NVIDIA 390.116'> [INFO ] [GL ] OpenGL vendor <b'NVIDIA Corporation'> [INFO ] [GL ] OpenGL renderer <b'GeForce GT 730M/PCIe/SSE2'> [INFO ] [GL ] OpenGL parsed version: 4, 6 [INFO ] [GL ] Shading version <b'4.60 NVIDIA'> [INFO ] [GL ] Texture max size <16384> [INFO ] [GL ] Texture max units <32> [INFO ] [Window ] auto add sdl2 input provider [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked Traceback (most recent call last): File "kivy/properties.pyx", line 840, in kivy.properties.ObservableDict.__getattr__ KeyError: 'box' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "main.py", line 19, in <module> Test().run()#O método run() inicializa o app File "/home/albuquerque/.local/lib/python3.6/site-packages/kivy/app.py", line 829, in run root = self.build() File "main.py", line 16, in build return Tarefas(["a","b", "c"]) File "main.py", line 10, in __init__ self.ids.box.add_widget(Label(text=tarefa, font_size=30))#procura nos ids da classe no arquivo text.kv o id box File "kivy/properties.pyx", line 843, in kivy.properties.ObservableDict.__getattr__ AttributeError: 'super' object has no attribute '__getattr__' Exception ignored in: functools.partial(<function _widget_destructor at 0x7f5c199612f0>, 3) Traceback (most recent call last): File "/home/albuquerque/.local/lib/python3.6/site-packages/kivy/uix/widget.py", line 265, in _widget_destructor File "/home/albuquerque/.local/lib/python3.6/site-packages/kivy/lang/builder.py", line 760, in unbind_widget File "kivy/weakproxy.pyx", line 32, in kivy.weakproxy.WeakProxy.__getat
a tela da interface não chega nem a abrir
a baixo estão os códigos:
main.py
from kivy.app import * #importar os métodos de APPP do kivy from kivy.uix.boxlayout import BoxLayout #empilha os widgets como se fossem caixas from kivy.uix.label import Label from kivy.uix.scrollview import ScrollView class Tarefas(ScrollView): def __init__(self, tarefas, **kwargs): #keyword arguments, o incrivel é que ele executa os argumentos colocados a mais super().__init__(**kwargs)#chama as funções da classe BoxLayout for tarefa in tarefas: self.ids.box.add_widget(Label(text=tarefa, font_size=30))#procura nos ids da classe no arquivo text.kv o id box class Test(App):#primeiro arquivo que o kivy procura (no caso, Text.kv) def build(self): #Métod o que constroi o aplicativo return Tarefas(["a","b", "c"]) Test().run()#O método run() inicializa o app
test.kv
<Tarefas>: BoxLayout: id:box #identificação do widget orientation:"vertical" size_hint_y:None height:self.minimum_height
estou meio que desesperado, então se conseguirem me ajudar, fico desesperadamente agradecido :D:
The post Ajuda com kivy (erro: AttributeError: ‘weakref’ object has no attribute ‘cline_in_traceback’) appeared first on 100% Private Proxies - Fast, Anonymous, Quality, Unlimited USA Private Proxy!.