2017-03-01 2 views
1

2 ~ 3 시간이 지나면 문제의 해결책을 찾으려하지만, 찾고있을 때에도 정확히 무엇이 잘못되고 있는지 찾을 수 없습니다. SO 또는 Kivy 문서에서 다른 사용자의 문제를 여기에서 확인하십시오.Kivy 버튼 위젯 : 속성 오류, 'fbind'속성이 없음

나는 현재 온라인 몇 가지 자습서를 따라하고, 내 코드가 정확히 그의 일치하지 않지만, 테스트로이 튜토리얼의 정확한 코드를 복제하는 동안에도, 내가 얻을 this simple one

주변에 장난감에 도착 Kivy에 버튼 위젯에 관련된 똑같은 오류 :

AttributeError: 'Button' object has no attribute 'fbind' 

이가 어떤 종류의 설치 문제와 관련 될 수 있습니까? 누구든지이 문제를 해결할 수 있습니까? main.py의 코드 여기

#:kivy 1.8.0 

<ScreenOne>: 
    Button: 
     text: "On SCREEN 1 >> Go to Screen 2" 
     on_press: root.manager.current = "screen2" 

<ScreenTwo>: 
    Button: 
     text: "On SCREEN 2 >> Go to Screen 3" 
     on_press: root.manager.current = "screen3" 

<ScreenThree>: 
    Button: 
     text: "On SCREEN 3 >> Go to Screen 1" 
     on_press: root.manager.current = "screen1" 


<Manager>: 
    id: screen_manager 

    screen_one: screen_one 
    screen_two: screen_two 
    screen_three: screen_three 

    ScreenOne: 
     id: screen_one 
     name: "screen1" 
     manager: screen_manager 

    ScreenTwo: 
     id: screen_two 
     name: "screen2" 
     manager: screen_manager 

    ScreenThree: 
     id: screen_three 
     name: "screen3" 
     manager: screen_manager 

됩니다 :

# -*- coding: utf-8 -*- 
from kivy.app import App 
from kivy.uix.screenmanager import ScreenManager, Screen 
from kivy.properties import ObjectProperty 

class ScreenThree(Screen): 
    pass 

class ScreenTwo(Screen): 
    pass 

class ScreenOne(Screen): 
    pass 

class Manager(ScreenManager): 
    screen_one = ObjectProperty(None) 
    screen_two = ObjectProperty(None) 
    screen_three = ObjectProperty(None) 

class ScreensApp(App): 

    def build(self): 
     return Manager() 

if __name__ == "__main__": 
    ScreensApp().run() 

편집 : 여기

[INFO    ] Kivy v1.8.0 
[INFO    ] [Logger  ] Record log in C:\Users\NoirFluo\.kivy\logs\kivy_17-03-01_64.txt 
[INFO    ] [Factory  ] 157 symbols loaded 
[DEBUG    ] [Cache  ] register <kv.lang> with limit=None, timeout=Nones 
[DEBUG    ] [Cache  ] register <kv.image> with limit=None, timeout=60s 
[DEBUG    ] [Cache  ] register <kv.atlas> with limit=None, timeout=Nones 
[INFO    ] [Image  ] Providers: img_tex, img_dds, img_pygame, img_pil, img_gif 
[DEBUG    ] [Cache  ] register <kv.texture> with limit=1000, timeout=60s 
[DEBUG    ] [Cache  ] register <kv.shader> with limit=1000, timeout=3600s 
[DEBUG    ] [App   ] Loading kv <C:/Users/NoirFluo/Desktop/Python/Kivy/TestProblemButton\screens.kv> 
[DEBUG    ] [Window  ] Ignored <egl_rpi> (import error) 
[INFO    ] [Window  ] Provider: pygame(['window_egl_rpi'] ignored) 
[DEBUG    ] [Window  ] Display driver windib 
[DEBUG    ] [Window  ] Actual window size: 800x600 
[DEBUG    ] [Window  ] Actual color bits r8 g8 b8 a8 
[DEBUG    ] [Window  ] Actual depth bits: 24 
[DEBUG    ] [Window  ] Actual stencil bits: 8 
[DEBUG    ] [Window  ] Actual multisampling samples: 2 
[INFO    ] [GL   ] OpenGL version <4.5.13464 Compatibility Profile Context 21.19.407.0> 
[INFO    ] [GL   ] OpenGL vendor <ATI Technologies Inc.> 
[INFO    ] [GL   ] OpenGL renderer <AMD Radeon HD 7800 Series> 
[INFO    ] [GL   ] OpenGL parsed version: 4, 5 
[INFO    ] [GL   ] Shading version <4.50> 
[INFO    ] [GL   ] Texture max size <16384> 
[INFO    ] [GL   ] Texture max units <32> 
[DEBUG    ] [Shader  ] Fragment compiled successfully 
[DEBUG    ] [Shader  ] Vertex compiled successfully 
[DEBUG    ] [ImagePygame ] Load <C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\data\glsl\default.png> 
[INFO    ] [Window  ] virtual keyboard not allowed, single mode, not docked 
[INFO    ] [Text  ] Provider: pygame 
GLEW initialization succeeded 

Traceback (most recent call last): 

    File "<ipython-input-1-414e3aba4aa1>", line 1, in <module> 
    runfile('C:/Users/NoirFluo/Desktop/Python/Kivy/TestProblemButton/main.py', wdir='C:/Users/NoirFluo/Desktop/Python/Kivy/TestProblemButton') 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile 
    execfile(filename, namespace) 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile 
    exec(compile(scripttext, filename, 'exec'), glob, loc) 

    File "C:/Users/NoirFluo/Desktop/Python/Kivy/TestProblemButton/main.py", line 26, in <module> 
    ScreensApp().run() 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\app.py", line 766, in run 
    root = self.build() 

    File "C:/Users/NoirFluo/Desktop/Python/Kivy/TestProblemButton/main.py", line 23, in build 
    return Manager() 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\uix\screenmanager.py", line 791, in __init__ 
    super(ScreenManager, self).__init__(**kwargs) 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\uix\floatlayout.py", line 66, in __init__ 
    super(FloatLayout, self).__init__(**kwargs) 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\uix\layout.py", line 63, in __init__ 
    super(Layout, self).__init__(**kwargs) 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\uix\widget.py", line 173, in __init__ 
    Builder.apply(self) 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\lang.py", line 1566, in apply 
    self._apply_rule(widget, rule, rule) 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\lang.py", line 1672, in _apply_rule 
    self.apply(child) 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\lang.py", line 1566, in apply 
    self._apply_rule(widget, rule, rule) 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\lang.py", line 1670, in _apply_rule 
    child = cls(__no_builder=True) 

    File "C:\Users\NoirFluo\Anaconda2\lib\site-packages\kivy\uix\behaviors\button.py", line 83, in __init__ 
    self.fbind('state', self.cancel_event) 

AttributeError: 'Button' object has no attribute 'fbind'` 

는 screens.kv 파일의 코드 MHH, 에디터가 먹은 내 "안녕하세요, 여러분!"그리고 내 게시물을 편집하여 되돌릴 수없는 이유가 있습니다. 그래서 여기에 올리겠습니다 : 안녕, 얘들 아! ^^ '

+2

화제가되었지만 왜 kivy 1.8.0을 사용합니까? – Juggernaut

답변

0

Kivy 1.8.0은 공룡이다. 곧 현재의 구식 안정 (1.9.1)보다 새로운 버전이 나올 것이다.

나는 당신의 코드를 시험해 보았고, 잘 작동한다. 문제가 없다면 1.8.0에서도 작동한다고 생각한다. 이제

이러한 작업 중 하나를 수행 할 수 있습니다

  • 완전히 (이것은 1.8.0을의 경우, 잘 갈)

  • 하는 설치 사용하려는 태그에서 Kivy 설치를 다시 설치 안정 버전

  • 설치 최신 Kivy 버전

instructions을 확인하는 방법을 확인하고 충분하지 않거나 너무 어려울 경우 this installer을 사용하십시오. 그냥 메모,이 아닙니다!kivy.bat과 똑같은 점이 있습니다 (1.8.0 패키지에 파일이있어 더 이상 존재하지 않습니다). 따라서 이전 버전의 대체 파일로 작동하지 않습니다.