3

I'm failing in running the following hello world on Kivy:

import kivy
kivy.require('1.7.0')

from kivy.app import App
from kivy.uix.button import Label

class HelloApp(App):
    def build(self):
        return Label(text='Hello World!')

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


with the following errors:

$ python hello1.py 
[INFO   ] Kivy v1.8.0
[INFO   ] [Logger      ] Record log in /home/Administrator/.kivy/logs/kivy_14-10-28_1.txt
 Traceback (most recent call last):
   File "hello1.py", line 5, in <module>
     from kivy.app import App
   File "/home/rbarakx/python/kivy/kivy/app.py", line 321, in <module>
     from kivy.base import runTouchApp, stopTouchApp
   File "/home/rbarakx/python/kivy/kivy/base.py", line 28, in <module>
     from kivy.clock import Clock
   File "/home/rbarakx/python/kivy/kivy/clock.py", line 177, in <module>
     _kernel32 = ctypes.windll.kernel32
 AttributeError: 'module' object has no attribute 'windll'
$ 


I suspect my Kivy cygwin's installation may be lacking.

Are there instructions for installing Kivy on cygwin? (googling the usual suspects did not produce any results)

boardrider
  • 5,882
  • 7
  • 49
  • 86

2 Answers2

2

The error suggests you encountered this bug where cygwin's python is compiled with os.name = posix. You may end up having to recompile it yourself... Alternatively maybe you could use MinGW instead, as documented here, or simply use the native Windows version.

Tobias Kienzler
  • 25,759
  • 22
  • 127
  • 221
2

What fixed the situation?

  1. Prior to installing Kivy, installing Cython and pygame with pip in Cygwin's Python 2.7
  2. Start Cygwin's X11 using startxwin
  3. Define $DISPLAY with export DISPLAY=:0.0
boardrider
  • 5,882
  • 7
  • 49
  • 86