title: Kivy in Qpython on Android device
body: <p>Mr Nooby Gonzales here</p>
  
  <p>Using Qpython3 on Android, trying to import Kivy module. </p>
  
  <p>Tried running the basic hello world program in snippets3 folder:</p>
  
  <pre><code>#-*-coding:utf8;-*-
  #qpy:2
  #qpy:kivy
  
  from kivy.app import App
  from kivy.uix.button import Button
  
  class TestApp(App):
      def build(self):
          # display a button with the text : Hello QPython 
          return Button(text='Hello QPython')
  
  TestApp().run()
  </code></pre>
  
  <p>but python loading screen "catch an exception: restart app", then returns to editor.</p>
  
  <p>Also tried to install module in pip, but need cyphon. Tried to install Cython but the below happened.   </p>
  
  <p>I'd appreciate any help or explanation, I've trawled all day for a solution. </p>
  
  <p>Thanks</p>
  
  <pre><code>/data/data/org.qpython.qpy3/files/bin/qpython-android5.sh "/storage/emulated/0/qpython/scripts3/pip_console.py" &amp;&amp; exit
  pts3/pip_console.py" &amp;&amp; exit      &lt;
  Input pip commands, ie: pip install {module}
  --&gt;pip install cython
  Downloading/unpacking cython
    Running setup.py egg_info for package cython
      Unable to find pgen, not compiling formal grammar.
  
      warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
      warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
      warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
      warning: no files found matching '*.pxd' under directory 'Cython/Utility'
  Installing collected packages: cython
    Running setup.py install for cython
      Unable to find pgen, not compiling formal grammar.
      warning: build_py_2to3: byte-compiling is disabled, skipping.
  
      Traceback (most recent call last):
        File "&lt;string&gt;", line 1, in &lt;module&gt;
        File "/storage/emulated/0/qpython/cache/pip-build/cython/setup.py", line 336, in &lt;module&gt;
          **setup_args
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/dist.py", line 917, in run_commands
          self.run_command(cmd)
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/dist.py", line 936, in run_command
          cmd_obj.run()
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/setuptools-1.1-py3.2.egg/setuptools/command/install.py", line 53, in run
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/command/install.py", line 569, in run
          self.run_command('build')
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/dist.py", line 936, in run_command
          cmd_obj.run()
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/command/build.py", line 126, in run
          self.run_command(cmd_name)
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/dist.py", line 936, in run_command
          cmd_obj.run()
        File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/storage/emulated/0/qpython/cache/pip-build/cython/setup.py", line 217, in build_extensions
          from Cython.Build.Dependencies import cythonize
        File "/storage/emulated/0/qpython/cache/pip-build/cython/build/lib.linux-armv7l-3.2/Cython/Build/__init__.py", line 1, in &lt;module&gt;
          from .Dependencies import cythonize
        File "/storage/emulated/0/qpython/cache/pip-build/cython/build/lib.linux-armv7l-3.2/Cython/Build/Dependencies.py", line 51, in &lt;module&gt;
          from ..Compiler.Main import Context, CompilationOptions, default_options
        File "/storage/emulated/0/qpython/cache/pip-build/cython/build/lib.linux-armv7l-3.2/Cython/Compiler/Main.py", line 27, in &lt;module&gt;
          from .StringEncoding import EncodedString
        File "/storage/emulated/0/qpython/cache/pip-build/cython/build/lib.linux-armv7l-3.2/Cython/Compiler/StringEncoding.py", line 54
          return EncodedString(u''.join(self.chars))
                                 ^
      SyntaxError: invalid syntax
      Complete output from command /data/data/org.qpython.qpy3/files/bin/python-android5 -c "import setuptools;__file__='/storage/emulated/0/qpython/cache/pip-build/cython/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /storage/emulated/0/qpython/cache/pip-z0g7yy-record/install-record.txt --single-version-externally-managed:
      running install
  
  running build
  
  running build_py
  
  Unable to find pgen, not compiling formal grammar.
  
  warning: build_py_2to3: byte-compiling is disabled, skipping.
  
  
  
  running build_ext
  
  Traceback (most recent call last):
  
    File "&lt;string&gt;", line 1, in &lt;module&gt;
  
    File "/storage/emulated/0/qpython/cache/pip-build/cython/setup.py", line 336, in &lt;module&gt;
  
      **setup_args
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/core.py", line 148, in setup
  
      dist.run_commands()
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/dist.py", line 917, in run_commands
  
      self.run_command(cmd)
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/dist.py", line 936, in run_command
  
      cmd_obj.run()
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/setuptools-1.1-py3.2.egg/setuptools/command/install.py", line 53, in run
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/command/install.py", line 569, in run
  
      self.run_command('build')
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/cmd.py", line 313, in run_command
  
      self.distribution.run_command(command)
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/dist.py", line 936, in run_command
  
      cmd_obj.run()
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/command/build.py", line 126, in run
  
      self.run_command(cmd_name)
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/cmd.py", line 313, in run_command
  
      self.distribution.run_command(command)
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/dist.py", line 936, in run_command
  
      cmd_obj.run()
  
    File "/data/data/org.qpython.qpy3/files/lib/python3.2/site-packages/distutils/command/build_ext.py", line 345, in run
  
      self.build_extensions()
  
    File "/storage/emulated/0/qpython/cache/pip-build/cython/setup.py", line 217, in build_extensions
  
      from Cython.Build.Dependencies import cythonize
  
    File "/storage/emulated/0/qpython/cache/pip-build/cython/build/lib.linux-armv7l-3.2/Cython/Build/__init__.py", line 1, in &lt;module&gt;
  
      from .Dependencies import cythonize
  
    File "/storage/emulated/0/qpython/cache/pip-build/cython/build/lib.linux-armv7l-3.2/Cython/Build/Dependencies.py", line 51, in &lt;module&gt;
  
      from ..Compiler.Main import Context, CompilationOptions, default_options
  
    File "/storage/emulated/0/qpython/cache/pip-build/cython/build/lib.linux-armv7l-3.2/Cython/Compiler/Main.py", line 27, in &lt;module&gt;
  
      from .StringEncoding import EncodedString
  
    File "/storage/emulated/0/qpython/cache/pip-build/cython/build/lib.linux-armv7l-3.2/Cython/Compiler/StringEncoding.py", line 54
  
      return EncodedString(u''.join(self.chars))
  
                             ^
  
  SyntaxError: invalid syntax
  
  ----------------------------------------
  Command /data/data/org.qpython.qpy3/files/bin/python-android5 -c "import setuptools;__file__='/storage/emulated/0/qpython/cache/pip-build/cython/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /storage/emulated/0/qpython/cache/pip-z0g7yy-record/install-record.txt --single-version-externally-managed failed with error code 1 in /storage/emulated/0/qpython/cache/pip-build/cython
  Storing complete log in /sdcard/qpython/.pip/pip.log
  --&gt;
  
  
    [1]: https://i.stack.imgur.com/uhNQT.png
  </code></pre>