2017-12-15 2 views
1

'pyforms'시도가 실패한 후 'kivy'로 손을 사용하기로 결정했습니다.Kivy 시작하기

그냥 this example code를 실행하려고 pip install kivy

통해 설치하지만 난이 오류가 발생합니다. 나는 그것이 무엇을 말하려고하는지 정말로 이해하지 못하기 때문에 이것을 어디에서 시작해야할지 모른다. 32 비트 Python3.4.4를 실행하는 Windows 10입니다. 다른 사람이 오류를 이해할 수 있습니까?

[INFO ] [Logger  ] Record log in U:\.kivy\logs\kivy_17-12-15_1.txt 
[INFO ] [Kivy  ] v1.10.0 
[INFO ] [Python  ] v3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] 
[INFO ] [Factory  ] 194 symbols loaded 
[INFO ] [Image  ] Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored) 
[INFO ] [Text  ] Provider: pil(['text_sdl2'] ignored) 
[CRITICAL] [Window  ] Unable to find any valuable Window provider. 
sdl2 - ImportError: DLL load failed: The specified module could not be found. 
    File "C:\Python34\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib 
    fromlist=[modulename], level=0) 
    File "C:\Python34\lib\site-packages\kivy\core\window\window_sdl2.py", line 26, in <module> 
    from kivy.core.window._window_sdl2 import _WindowSDL2Storage 

[CRITICAL] [App   ] Unable to get a Window, abort. 
Exception ignored in: 'kivy.properties.dpi2px' 
Traceback (most recent call last): 
    File "C:\Python34\lib\site-packages\kivy\utils.py", line 496, in __get__ 
    retval = self.func(inst) 
    File "C:\Python34\lib\site-packages\kivy\metrics.py", line 174, in dpi 
    EventLoop.ensure_window() 
    File "C:\Python34\lib\site-packages\kivy\base.py", line 127, in ensure_window 
    sys.exit(1) 
SystemExit: 1 
[CRITICAL] [App   ] Unable to get a Window, abort. 

예제 코드 :

from kivy.app import App 
from kivy.uix.label import Label 
from kivy.clock import Clock 
from kivy.graphics import Color, Rectangle 


class TestApp(App): 

    @staticmethod 
    def get_x(label, ref_x): 
     """ Return the x value of the ref/anchor relative to the canvas """ 
     return label.center_x - label.texture_size[0] * 0.5 + ref_x 

    @staticmethod 
    def get_y(label, ref_y): 
     """ Return the y value of the ref/anchor relative to the canvas """ 
     # Note the inversion of direction, as y values start at the top of 
     # the texture and increase downwards 
     return label.center_y + label.texture_size[1] * 0.5 - ref_y 

    def show_marks(self, label): 

     # Indicate the position of the anchors with a red top marker 
     for name, anc in label.anchors.items(): 
      with label.canvas: 
       Color(1, 0, 0) 
       Rectangle(pos=(self.get_x(label, anc[0]), 
           self.get_y(label, anc[1])), 
          size=(3, 3)) 

     # Draw a green surround around the refs. Note the sizes y inversion 
     for name, boxes in label.refs.items(): 
      for box in boxes: 
       with label.canvas: 
        Color(0, 1, 0, 0.25) 
        Rectangle(pos=(self.get_x(label, box[0]), 
            self.get_y(label, box[1])), 
           size=(box[2] - box[0], 
            box[1] - box[3])) 

    def build(self): 
     label = Label(
      text='[anchor=a]a\nChars [anchor=b]b\n[ref=myref]ref[/ref]', 
      markup=True) 
     Clock.schedule_once(lambda dt: self.show_marks(label), 1) 
     return label 

TestApp().run() 
+0

"정보 제공"메시지 다음에 "오류가있는 모든 Window 공급자를 찾을 수 없습니다."라는 내용의 첫 번째 오류가 발생합니다. 이것은 https://stackoverflow.com/q/44219563/2564301 – usr2564301

답변

0

Kivy 사이트에서 installation guide을 따르십시오. 다음과 같은 종속성도 설치해야합니다.

python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew 
python -m pip install kivy.deps.gstreamer 
+0

의 사본을 제안했으며 아직 메시지를 받았습니다. – WhatsThePoint

+0

@WhatsThePoint 모든 것이 성공적으로 완료 되었습니까? 'python -m pip freeze'는 당신에게 kivy와'kivy.deps.sdl2'를 포함한 모든 의존성을 보여줍니까? kivy의 야간 휠 [https://kivy.org/docs/installation/installation-windows.html#nightly-wheel-installation]을 설치하고 오류가 여전히 있는지 확인해 볼 수 있습니까? –

+0

나는이 Kivy == 1.10.0 Kivy-Garden == 0.1.4 kivy.deps.angle == 0.1.6 kivy.deps.glew == 0.1.9 kivy.deps.gstreamer == 0.1 .12 kivy.deps.sdl2 == 0.1.17 – WhatsThePoint